How to conditionally choose from two channels in NextFlow:
grouped_interval_vcf_ch=(params.splitIntervalOverlapLength && params.splitIntervalOverlapLength.toInteger() > 0
? trimmed_vcf_ch
: interval_vcfs_3
)
How to conditionally choose from two channels in NextFlow:
grouped_interval_vcf_ch=(params.splitIntervalOverlapLength && params.splitIntervalOverlapLength.toInteger() > 0
? trimmed_vcf_ch
: interval_vcfs_3
)
How to collect all files related by prefix in NextFlow:
Example input channel:
interval_bams_ch:
[ file('73-50_L001_raw_variants_1.bam') ]
[ file('73-50_L001_raw_variants_2.bam') ]
[ file('73-50_L002_raw_variants_1.bam') ]
[ file('73-50_L002_raw_variants_2.bam') ]
Process code:
bam_name_parts_ch = interval_bams_ch.map { file ->
def name = file.baseName.replaceFirst(/_raw_variants_.*/, '')
tuple(name, file)
}.groupTuple()
Example output:
[ '73-50_L001', [file('73-50_L001_raw_variants_1.bam'), file('73-50_L001_raw_variants_2.bam')] ]
[ '73-50_L002', [file('73-50_L002_raw_variants_1.bam'), file('73-50_L002_raw_variants_2.bam')] ]
How to collect all files from one channel and associate/combine them with elements of another channel in NextFlow:
Example Input channels:
bam_for_collect_ch2:
[ file('73-50_L002.bam') ]
[ file('73-50_L001.bam') ]
interval_vcfs_3:
[ file('73-50_L001_raw_variants_1.vcf.gz') ]
[ file('73-50_L001_raw_variants_2.vcf.gz') ]
[ file('73-50_L002_raw_variants_1.vcf.gz') ]
[ file('73-50_L002_raw_variants_2.vcf.gz') ]
Process code:
input:
set val(pair_id), val(all_vcf) from bam_for_collect_ch2.map({ file -> file.baseName }).combine(interval_vcfs_3.collect().map({ file -> file.baseName }).toList())
Example output:
[ '73-50_L002', ['73-50_L002_raw_variants_1.vcf.gz', '73-50_L002_raw_variants_2.vcf.gz'] ]
[ '73-50_L001', ['73-50_L001_raw_variants_1.vcf.gz', '73-50_L001_raw_variants_2.vcf.gz'] ]
How to get rid of "WARNING : No mitochondrion chromosome found" in SnpEff:
Prefix the contig name with MT.
How to clone a public GitHub repository with VS Code and push it to a private GitHub repository.
Open a terminal in VS Code (View>terminal)
PS C:\Users\github> cd sarek
PS C:\Users\github\sarek> git remote remove origin
PS C:\Users\github\sarek> git remote add origin https://github.com/ink-blot/sarek.git
PS C:\Users\github\sarek> git branch
* master
PS C:\Users\github\sarek> git push -u origin master
If it doesn't promptly start pushing, an authorisation screen should (eventually) appear (it may take a few minutes).
The token method is preferred:
Optional steps if you want to fetch updates from the original nf-core/sarek repository in the future, add it as an upstream remote:
PS C:\Users\github\sarek> git remote add upstream https://github.com/nf-core/sarek.git
PS C:\Users\github\sarek> git fetch upstream
PS C:\Users\github\sarek> git merge upstream/main