-
Notifications
You must be signed in to change notification settings - Fork 1
feat: aviti integration and SAMBA structure update #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
73e5085
4006a1c
c4f776e
6b9f01b
1369ad4
248a260
883ba00
1f191a8
919c57c
830b287
70093aa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -106,8 +106,13 @@ def copyCellRanger(config, d): | |
| # /data/xxx/yyyy_lanes_1/Analysis_2526_zzzz/RNA-Seqsinglecell_mouse -> | ||
| # yyyy_lanes_1 | ||
| lane_dir = Path(d).parents[1].stem | ||
| current_year = "20" + str(lane_dir)[0:2] | ||
| year_postfix = Path("Sequence_Quality_" + current_year) / Path("Illumina_" + current_year) | ||
| sequencing_type=lane_dir.split("_")[1] | ||
| if sequencing_type.startswith("AV"): | ||
|
||
| current_year = str(lane_dir)[0:4] | ||
| year_postfix = Path("Sequence_Quality_" + current_year) / Path("AVITI24_" + current_year) | ||
| else: | ||
| current_year = "20" + str(lane_dir)[0:2] | ||
| year_postfix = Path("Sequence_Quality_" + current_year) / Path("Illumina_" + current_year) | ||
| for fname in files: | ||
| # to seqfac dir. | ||
| nname = fname.split('/') | ||
|
|
@@ -144,8 +149,14 @@ def copyRELACS(config, d): | |
| # /data/xxx/yyyy_lanes_1/Analysis_2526_zzzz/ChIP-Seq_mouse/RELACS_demultiplexing -> | ||
| # Sequence_Quality_yyyy/Illumina_yyyy/yyyy_lanes_1 | ||
| lane_dir = Path(d).parents[1].stem | ||
| current_year = "20" + str(lane_dir)[0:2] | ||
| year_postfix = Path("Sequence_Quality_" + current_year) / Path("Illumina_" + current_year) | ||
| sequencing_type=lane_dir.split("_")[1] | ||
|
||
| if sequencing_type.startswith("AV"): | ||
| current_year = str(lane_dir)[0:4] | ||
| year_postfix = Path("Sequence_Quality_" + current_year) / Path("AVITI24_" + current_year) | ||
| else: | ||
| current_year = "20" + str(lane_dir)[0:2] | ||
| year_postfix = Path("Sequence_Quality_" + current_year) / Path("Illumina_" + current_year) | ||
|
|
||
| log.info(f"copyRELACS - copying over RELACS files to samba path {year_postfix}") | ||
| for fname in files: | ||
| # to seqfac dir. | ||
|
|
@@ -243,13 +254,19 @@ def RELACS(config, group, project, organism, libraryType, tuples): | |
| if os.path.exists(os.path.join(outputDir, "analysis.done")): | ||
| return outputDir, 0, True | ||
|
|
||
| sampleSheet = "/dont_touch_this/short_runs/{}/RELACS_Project_{}.txt".format(runID, BRB.misc.pacifier(project)) | ||
| project = BRB.misc.pacifier(project) | ||
| sampleSheet = f"/dont_touch_this/short_runs/{runID}/RELACS_Project_{project}.txt" | ||
|
|
||
| # Fallback if exact path doesn't exist | ||
|
||
| if not os.path.exists(sampleSheet): | ||
| matches = glob.glob(f"/dont_touch_this/short_runs/AV*/{runID}/RELACS_Project_{project}.txt") | ||
| sampleSheet = matches[0] if matches else None | ||
|
|
||
| if not os.path.exists(sampleSheet) and not os.path.exists(os.path.join(outputDir, "RELACS_sampleSheet.txt")): | ||
| log.critical("RELACS: wrong samplesheet name: {}".format(sampleSheet)) | ||
| print("wrong samplesheet name!", sampleSheet) | ||
| return None, 1, False | ||
|
|
||
| project = BRB.misc.pacifier(project) | ||
|
|
||
| baseDir = "{}/{}/{}/{}/Project_{}".format(config.get('Paths', 'groupData'), | ||
| BRB.misc.pacifier(group), | ||
| BRB.misc.getLatestSeqdir(config.get('Paths','groupData'), group), | ||
|
|
@@ -300,7 +317,7 @@ def RELACS(config, group, project, organism, libraryType, tuples): | |
|
|
||
| # Back to the normal DNA pipeline | ||
| CMD = "PATH={}/bin:$PATH".format(os.path.join(config.get('Options', 'snakemakeWorkflowBaseDir'))) | ||
| CMD = [CMD, 'DNAmapping', '--DAG', '--trim', '--UMIDedup', '--mapq', '3', '-i', outputDir, '-o', outputDir, org_yaml] | ||
| CMD = [CMD, 'DNAmapping', '--DAG', '--trim', r"--trimmerOptions '-a AGATCGGAAGAG -A AGATCGGAAGAG'", '--UMIDedup', '--mapq', '3', '-i', outputDir, '-o', outputDir, org_yaml] | ||
| log.info(f"RELACS DNA wf CMD: {CMD}") | ||
| try: | ||
| subprocess.check_call(' '.join(CMD), shell=True) | ||
|
|
@@ -451,7 +468,8 @@ def scRNAseq(config, group, project, organism, libraryType, tuples): | |
| if 'GRCh38' in org_yaml: | ||
| org_yaml = 'GRCh38' | ||
| PE = linkFiles(config, group, project, outputDir, tuples) | ||
| CMD = [config.get('10x', 'RNA'), outputDir, outputDir, org_yaml] | ||
| snakeMakePath= "{}/bin".format(os.path.join(config.get('Options', 'snakemakeWorkflowBaseDir'))) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not reflected in the ini file
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for noticing! |
||
| CMD = [config.get('10x', 'RNA'), outputDir, outputDir, org_yaml, " --snakemakePath ", snakeMakePath] | ||
| log.info(f"scRNA wf CMD: {' '.join(CMD)}") | ||
| try: | ||
| subprocess.check_call(' '.join(CMD), shell=True) | ||
|
|
@@ -544,7 +562,7 @@ def scATAC(config, group, project, organism, libraryType, tuples): | |
| """ | ||
| scATAC 10x | ||
| """ | ||
|
|
||
| project = BRB.misc.pacifier(project) | ||
| org_name, org_label, org_yaml = organism | ||
| outputDir = createPath(config, group, project, org_label, libraryType, tuples) | ||
|
|
@@ -563,10 +581,13 @@ def scATAC(config, group, project, organism, libraryType, tuples): | |
| BRB.misc.getLatestSeqdir(config.get('Paths','groupData'), group), | ||
| config.get('Options', 'runID'), | ||
| BRB.misc.pacifier(project)) | ||
| snakeMakePath= "{}/bin".format(os.path.join(config.get('Options', 'snakemakeWorkflowBaseDir'))) | ||
| CMD = config.get('10x', 'ATAC')+" -i "+inDir | ||
| CMD += " -o "+outputDir | ||
| CMD += " "+org_yaml | ||
| CMD += " --projectID "+project+" --samples "+samples | ||
| CMD += " --snakemakePath "+snakeMakePath | ||
|
|
||
| log.info(f"scATAC wf CMD: {CMD}") | ||
| try: | ||
| subprocess.check_call(CMD, shell=True) | ||
|
|
@@ -612,7 +633,6 @@ def GetResults(config, project, libraries): | |
| ) | ||
| log.info(f"Processing {dataPath}") | ||
| except: | ||
| print("external data") | ||
| ignore = True | ||
| validLibraryTypes = {v: i for i, v in enumerate(config.get('Options', 'validLibraryTypes').split(','))} | ||
| pipelines = config.get('Options', 'pipelines').split(',') | ||
|
|
@@ -621,7 +641,6 @@ def GetResults(config, project, libraries): | |
| skipList = [] | ||
| external_skipList = [] | ||
| org_dict = {} | ||
| print(libraries) | ||
| for library, v in libraries.items(): | ||
| sampleName, libraryType, libraryProtocol, organism, indexType, requestDepth = v | ||
| org_name, org_label, org_yaml = organism | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not directly from the folder name ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the notice! opted for this approach.