-
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
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
73e5085
Flowcell ids (aviti) <--> Parkour communication
4006a1c
SAMBA structure update for output and workflow params updates
c4f776e
Aviti enable for querying in parkour
6b9f01b
Aviti enable for querying in parkour
1369ad4
SAMBA structure update for output and workflow params updates
248a260
Merge branch 'main' into aviti
WardDeb 883ba00
Aviti detection uniformity
1f191a8
SAMBA + Aviti detection removed duplicated part
919c57c
path updated to snakemakeWorkflowBaseDir
830b287
sequencing type detection and flow cell id extraction tests are added
70093aa
Merge branch 'aviti' of github.com:maxplanck-ie/BigRedButton into aviti
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,6 +87,16 @@ def relinkFiles(config, group, project, org_label, libraryType, tuples): | |
| log.info(f"no multiqc report under {mqcf}.") | ||
|
|
||
|
|
||
| def getsambaPath(lane_dir,Sequencer): | ||
| if Sequencer == "Aviti": | ||
| 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) | ||
| return current_year, year_postfix | ||
|
|
||
|
|
||
| def copyCellRanger(config, d): | ||
| ''' | ||
| copy Cellranger web_summaries to sequencing facility lane subdirectory & bioinfocore qc directory. | ||
|
|
@@ -102,12 +112,13 @@ def copyCellRanger(config, d): | |
| ''' | ||
|
|
||
| files = glob.glob(os.path.join(d, '*/outs/', 'web_summary.html')) | ||
|
|
||
| sequencing_type= config.get("Options", "sequencerType") | ||
|
|
||
|
|
||
| # /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) | ||
| current_year, year_postfix = getsambaPath(lane_dir,sequencing_type) | ||
| for fname in files: | ||
| # to seqfac dir. | ||
| nname = fname.split('/') | ||
|
|
@@ -140,12 +151,12 @@ def copyRELACS(config, d): | |
| ''' | ||
|
|
||
| files = glob.glob(os.path.join(d, "RELACS_demultiplexing", 'Sample*/', '*_fig.png')) + glob.glob(os.path.join(d, "multiQC", '*html')) | ||
| sequencing_type=config.get("Options", "sequencerType") | ||
|
|
||
| # /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) | ||
| current_year, year_postfix = getsambaPath(lane_dir, sequencing_type) | ||
| log.info(f"copyRELACS - copying over RELACS files to samba path {year_postfix}") | ||
| for fname in files: | ||
| # to seqfac dir. | ||
|
|
@@ -238,18 +249,26 @@ def RELACS(config, group, project, organism, libraryType, tuples): | |
| There better not be any duplicate RELACS sample names! | ||
| """ | ||
| runID = config.get('Options', 'runID').split("_lanes")[0] | ||
| sequencerType = config.get('Options', 'sequencerType') | ||
| org_name, org_label, org_yaml = organism | ||
| outputDir = createPath(config, group, BRB.misc.pacifier(project), org_label, 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) | ||
|
|
||
| if sequencerType == "Aviti": | ||
| matches = glob.glob(f"/dont_touch_this/short_runs/AV*/{runID}/RELACS_Project_{project}.txt") | ||
| sampleSheet = matches[0] if matches else None | ||
| else: | ||
| 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) 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 +319,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 +470,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 +564,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 +583,14 @@ 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 += " --projectID "+project+" --samples "+ samples | ||
| CMD += " --snakemakePath "+snakeMakePath | ||
|
|
||
| log.info(f"scATAC wf CMD: {CMD}") | ||
| try: | ||
| subprocess.check_call(CMD, shell=True) | ||
|
|
@@ -612,7 +636,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 +644,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 | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.