snsxt.sns_classes package¶
Subpackages¶
Submodules¶
snsxt.sns_classes.classes module¶
General utility classes for the program
-
class
snsxt.sns_classes.classes.
SnsAnalysisSample
(id, analysis_config, sns_config, extra_handlers=None)[source]¶ Bases:
util.classes.AnalysisItem
Container for metadata about a sample in the sns WES targeted exome sequencing run analysis output
from sns_classes import SnsWESAnalysisOutput import config d = ‘/ifs/data/molecpathlab/scripts/snsxt/snsxt/fixtures/sns_output/sns_analysis1’ x = SnsWESAnalysisOutput(dir = d, id = ‘sns_analysis1’, sns_config = config.sns) samples = x.get_samples() sample = samples[0] sample.sns_config[‘analysis_output_index’].items() pattern = sample.id + ‘.dd.ra.rc.bam’ sample.get_output_files(analysis_step = ‘BAM-GATK-RA-RC’, pattern = pattern)
-
_init_analysis_attrs
(analysis_config=None)[source]¶ Initialize the attributes passed from the parent analysis
-
-
class
snsxt.sns_classes.classes.
SnsWESAnalysisOutput
(dir, id, sns_config, results_id=None, extra_handlers=None)[source]¶ Bases:
util.classes.AnalysisItem
Container for metadata about a sns WES targeted exome sequencing run analysis
-
__init__
(dir, id, sns_config, results_id=None, extra_handlers=None)[source]¶ Initialize the object
dir = path to the analysis output directory id = ID for the analysis, typically the parent analysis output dir name, corresponding to a NextSeq run ID results_id = typically a time-stamped ID of the results for the analysis, and the subdir name for the anaysis output
e.g.: dir = “/ifs/data/molecpathlab/NGS580_WES/170623_NB501073_0015_AHY5Y3BGX2/results_2017-06-26_20-11-26” id = “170623_NB501073_0015_AHY5Y3BGX2” results_id = “results_2017-06-26_20-11-26”
sns_config = dictionary of configuration items for the run; requires ‘analysis_output_index’ dict, and ‘email_recipients’ extra_filehandlers = None or a list of handlers to add
from sns_classes import SnsWESAnalysisOutput import config d = ‘/ifs/data/molecpathlab/scripts/snsxt/snsxt/fixtures/sns_output/sns_analysis1’ x = SnsWESAnalysisOutput(dir = d, id = ‘sns_analysis1’, sns_config = config.sns)
-
_init_dirs
()[source]¶ Initialize the paths attributes for items associated with the sequencing run from list of dirnames and filename patterns for the output steps in the sns WES analysis output
-
_init_files
()[source]¶ Initialize the paths to files that might not have consistent naming including: the targets .bed file with the chromosome target regions
-
_init_static_files
()[source]¶ Initialize paths to files that should always exist in the same location for an analysis output directory
-
check_qsub_log_errors_present
(log_files=None, err_patterns=('ERROR:', ))[source]¶ Check the qsub logs for errors
-
expected_static_files
()[source]¶ Return a dict of files that are expected to exist in the analysis dir
-
get_qsub_logfiles
(logdir=None)[source]¶ Get the list of log files from the qsub dir
logdir = x.list_none(x.get_dirs(‘logs-qsub’)) log_files = [item for item in find.find(logdir, search_type = ‘file’)]
-
get_samples
(samplesIDs=None)[source]¶ Get the samples for the analysis samplesIDs is a list of character string sample ID’s
-
get_samplesIDs_from_samples_fastq_raw
(samples_fastq_raw_file=None)[source]¶ Get the samples in the run from the samples_fastq_raw file
-
get_summary_combined_contents
(summary_combined_wes_file=None)[source]¶ Get the contents of the ‘summary-combined.wes.csv’ file
-
snsxt.sns_classes.test module¶
Run all the unit tests
snsxt.sns_classes.test_sns_classes module¶
unit tests for the find module
-
class
snsxt.sns_classes.test_sns_classes.
TestAnalysisItem
(methodName='runTest')[source]¶ Bases:
unittest.case.TestCase