When I run the command `nextflow run nf-core/sarek...
# sarek
s
When I run the command
nextflow run nf-core/sarek -r 3.5.1
for WES variant calling from my raw FASTQ datasets, do I need to include the parameter
--wes TRUE
? Thanks!
👍 1
r
just setting
--wes
should be enough. And yes if you want tools to use wes specific flags
s
Hi Rike, Thanks!
t
I would recommend setting
--intervals
to a (padded) BED file with your target exons (provided by the manufacturer of the WES kit). To avoid errors, I strip any header lines and keep only the first 3 columns.
s
@Thomas Danhorn Apologies, I'm having trouble fully understanding these processes. Do you happen to have any documentation or sample code that demonstrates how to use the
--intervals
parameter? Thank you!
r
--intervals wes.bed
reads that fall outside of the regions are disregarded. If you want to make sure that reads on the edges are not removed, it's recommended to pad the bed file with some bases left and right.
bedtools
offers tooling for this:
Copy code
# sort coordinates
    sort -V -k1,1 -k2,2 $1 > ${1/.bed/.sorted.bed}

    # GATK recommends padding by 100bp: https://gatk.broadinstitute.org/hc/en-us/articles/360035889551-When-should-I-restrict-my-analysis-to-specific-intervals- --> Adjust this for your readlength
    bedtools slop -i ${1/.bed/.sorted.bed} -b 100 -g <genome>.fasta.fai > ${1/.bed/.sorted.padded.bed}

    # Merge overlapping or neighboring regions
    bedtools merge -i ${1/.bed/.sorted.padded.bed} > ${1/.bed/.sorted.padded.merged.bed}
t
When you make the WES libraries, that is done with some kit, e.g. by Agilent or some other company. They should provide the appropriate BED files for their respective kits. (Ask them if your are in doubt.) Normally there are different kinds, e.g. Agilent provides one for the actual targets they had in mind when designing the kit, then there is one that in addition includes regions sufficiently homologous to the targets that they are expected to be enriched, there is a padded version (like Rike described), and there is a file for the actual baits used. I tend to use the padded one.