-
Notifications
You must be signed in to change notification settings - Fork 6
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
Automatically assign sex if unknown #148
Changes from all commits
1958538
af8cdc8
8b2587d
8a74d72
c3351e6
d4cc375
72b9f4c
2a50981
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
sample,file,family_id,paternal_id,maternal_id,sex,phenotype | ||
sample_1,/path/to/fastq_or_bam/files/sample_1.fastq.gz,FAM,PAT,MAT,1,1 | ||
sample_1,/path/to/fastq_or_bam/files/sample_1.fastq.gz,FAM,PAT,MAT,0,1 | ||
sample_2,/path/to/fastq_or_bam/files/sample_2.bam,FAM,PAT,MAT,1,1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,9 +30,21 @@ process { | |
|
||
withName: '.*:ALIGN_READS:MINIMAP2_ALIGN_UNSPLIT' { | ||
if(params.preset == 'revio' | params.preset == 'pacbio') { | ||
ext.args = "-y -x map-hifi --secondary=no -Y" | ||
} else if(params.preset == 'ONT_R9' | params.preset == 'ONT_R10') { | ||
ext.args = "-y -x map-ont --secondary=no -Y" | ||
ext.args = { [ | ||
"-y", | ||
"-x map-hifi", | ||
"--secondary=no", | ||
"-Y", | ||
"-R @RG\\\\tID:${meta.id}\\\\tSM:${meta.id}" | ||
].join(' ') } | ||
} else if(params.preset == 'ONT_R10') { | ||
ext.args = { [ | ||
"-y", | ||
"-x map-ont", | ||
"--secondary=no", | ||
"-Y", | ||
"-R @RG\\\\tID:${meta.id}\\\\tSM:${meta.id}" | ||
].join(' ') } | ||
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. To me, this does not seem to relate the to sex check, so I would add a line to the changelog about it 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. Adding RG was necessary for somalier, but I see your point as the change is broad. Will add to changelog! |
||
} | ||
|
||
publishDir = [ | ||
|
@@ -53,9 +65,21 @@ process { | |
|
||
withName: '.*:ALIGN_READS:MINIMAP2_ALIGN_SPLIT' { | ||
if(params.preset == 'revio' | params.preset == 'pacbio') { | ||
ext.args = "-y -x map-hifi --secondary=no -Y" | ||
} else if(params.preset == 'ONT_R9' | params.preset == 'ONT_R10') { | ||
ext.args = "-y -x map-ont --secondary=no -Y" | ||
ext.args = { [ | ||
"-y", | ||
"-x map-hifi", | ||
"--secondary=no", | ||
"-Y", | ||
"-R @RG\\\\tID:${meta.id}\\\\tSM:${meta.id}" | ||
].join(' ') } | ||
} else if(params.preset == 'ONT_R10') { | ||
ext.args = { [ | ||
"-y", | ||
"-x map-ont", | ||
"--secondary=no", | ||
"-Y", | ||
"-R @RG\\\\tID:${meta.id}\\\\tSM:${meta.id}" | ||
].join(' ') } | ||
} | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Config file for defining DSL2 per module options and publishing paths | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Available keys to override module options: | ||
ext.args = Additional arguments appended to command in module. | ||
ext.args2 = Second set of arguments appended to command in module (multi-tool modules). | ||
ext.args3 = Third set of arguments appended to command in module (multi-tool modules). | ||
ext.prefix = File name prefix for output files. | ||
---------------------------------------------------------------------------------------- | ||
*/ | ||
|
||
process { | ||
|
||
/* | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
Extract relate somalier | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
*/ | ||
|
||
withName: '.*:BAM_INFER_SEX:.*' { | ||
publishDir = [ | ||
enabled: false, | ||
] | ||
} | ||
|
||
withName: '.*:BAM_INFER_SEX:SOMALIER_RELATE' { | ||
|
||
ext.args = '--infer' | ||
|
||
publishDir = [ | ||
path: { "${params.outdir}/qc_aligned_reads/somalier/relate/${meta.id}" }, | ||
mode: params.publish_dir_mode, | ||
saveAs: { filename -> filename.equals('versions.yml') ? null : filename } | ||
] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import nextflow.Nextflow | ||
|
||
class CustomFunctions { | ||
|
||
// Function to generate a pedigree file | ||
public static File makePed(samples, outdir) { | ||
def case_name = "multisample" | ||
def outfile = new File(outdir +"/pipeline_info/${case_name}" + '.ped') | ||
outfile.text = ['#family_id', 'sample_id', 'father', 'mother', 'sex', 'phenotype'].join('\t') | ||
def samples_list = [] | ||
for(int i = 0; i<samples.size(); i++) { | ||
samples[i] = samples[i][0] | ||
def sample_name = samples[i].id | ||
if (!samples_list.contains(sample_name)) { | ||
outfile.append('\n' + [samples[i].family_id, sample_name, samples[i].paternal_id, samples[i].maternal_id, samples[i].sex, samples[i].phenotype].join('\t')); | ||
samples_list.add(sample_name) | ||
} | ||
} | ||
return outfile | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Would it make sense to have 2 tests samplesheet, one with and one without the sex assigned to test all logical gates? Maybe just a stub run. Just throwing ideas
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.
Absolutely! And I have, but you can't see it here.
I removed the test data and samplesheets from this repository, and put it in the nallo branch of the GMS fork of test-datasets to make it more similar to how it's handled in for example raredisease and rnafusion. I made a PR to update the test data and samplesheets used (the multisample test now includes one sample where sex is set to 0).
But maybe that is problematic, because:
Do you have a suggestion for the best solution here? @jemten?
I'm sure I will have to continue to refine the test data.
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.
I think that it is a good idea to hav the specific commit hash in the url. As you say that way we could have a different sample sheet in master and dev.
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.
Might make a patch to master then.