Heads up:
We’re moving the GATK website, docs and forum to a new platform. Read the full story and breakdown of key changes on this blog.
Notice:
If you happen to see a question you know the answer to, please do chime in and help your fellow community members. We encourage our fourm members to be more involved, jump in and help out your fellow researchers with their questions. GATK forum is a community forum and helping each other with using GATK tools and research is the cornerstone of our success as a genomics research community.We appreciate your help!

Test-drive the GATK tools and Best Practices pipelines on Terra


Check out this blog post to learn how you can get started with GATK and try out the pipelines in preconfigured workspaces (with a user-friendly interface!) without having to install anything.
Attention:
We will be out of the office for a Broad Institute event from Dec 10th to Dec 11th 2019. We will be back to monitor the GATK forum on Dec 12th 2019. In the meantime we encourage you to help out other community members with their queries.
Thank you for your patience!

ClipReads last bases

Hello Everybody,
I have a question regarding how to indicate last bases of every read...
The walker ClipReads with the option -CT 'n1,n2' is able to clip reads from position n1 upto position n2, so -CT '1-8' clips the first 8 bases of every read. Is there a way to indicate this walker to clip the last bases of every read? something like 'end-10, end'....

Thanks
Daniel

Tagged:

Best Answers

Answers

  • Thanks Geraldine,

    Do you know how to edit the cigar string while soft clipping? I mean how to produce the new cigar from the old one after sot clippiing.. That is the tricky part to achieve a succesfull clipping, Knowing that would be easy to program any kind of clipping. Thanks again.
    Saludos

    Daneil

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie admin

    @dansilber asked:
    how to produce the new cigar from the old one after soft clipping

    Have a look at the source code :
    https://github.com/broadgsa/gatk/blob/master/public/java/src/org/broadinstitute/sting/gatk/walkers/ClipReads.java

  • Hi all,
    I guess it's a related question: I try to softclip (change CIGAR string) an aligned BAM file using quality score on reads with N's and Q0 both on 5prime and 3prime. Actually, only the 5prime is soft clipped!

    Here is an example:

    Original Read:
    HWI-M01658:22:140313_M01658_0022_000000000-A6PBW:1:1113:16347:27508 83 chr19 33791997 60 14S237M = 33791999 -235 NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCCTCGCAGGGAGAAGCCACCGCCTGGCCCCCTCATCTTAGACGCGCCAAGTCCGGCGCAGAGGAAGGGAGGGGACACGCGGAGCAGGCCAGGCTCTCAGGAGGCACCGGAATCTCCTAGTCCTGGCTCGCACGGCTCGGGCAAGCCTCGAGATTCGGCGACCCCAAACCACTCCCTGGGTCCCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN ######################################B9-BFFBB;;/.;.:A;B;[email protected]/////FFAA--9.9/FEFBB;BBDB?FF;;;/.;.9.DF9;99.-@-.DFEFFGGC.FGGGGFFFGGF.0;/9?9?CGBGHGC:/[email protected]>---GGCAC?/CDA1CGGAGGDBCCE?EE?EDG?EFF>A1?GHFGFGCGEG############################## RG:Z:1 NM:i:3 AS:i:222 XS:i:0
    (half)Clipped Read:
    HWI-M01658:22:140313_M01658_0022_000000000-A6PBW:1:1113:16347:27508 83 chr19 33792021 60 38S213M = 33791999 -235 NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCCTCGCAGGGAGAAGCCACCGCCTGGCCCCCTCATCTTAGACGCGCCAAGTCCGGCGCAGAGGAAGGGAGGGGACACGCGGAGCAGGCCAGGCTCTCAGGAGGCACCGGAATCTCCTAGTCCTGGCTCGCACGGCTCGGGCAAGCCTCGAGATTCGGCGACCCCAAACCACTCCCTGGGTCCCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN ######################################B9-BFFBB;;/.;.:A;B;[email protected]/////FFAA--9.9/FEFBB;BBDB?FF;;;/.;.9.DF9;99.-@-.DFEFFGGC.FGGGGFFFGGF.0;/9?9?CGBGHGC:/[email protected]>---GGCAC?/CDA1CGGAGGDBCCE?EE?EDG?EFF>A1?GHFGFGCGEG############################## RG:Z:1 NM:i:3 AS:i:222 XS:i:0

    As you can see, the CIGAR string change from 14S237M to 38S213M, including a new soft clipped region of 24 bases at the 5prime. However, nothing was added at the 3prime, as it should add 30S and modify 213M into 183M (right). So, from 14S237M to 38S183M30S, as below:

    (Fully)Clipped Read:
    HWI-M01658:22:140313_M01658_0022_000000000-A6PBW:1:1113:16347:27508 83 chr19 33792021 60 38S183M30S = 33791999 -235 NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNCCTCGCAGGGAGAAGCCACCGCCTGGCCCCCTCATCTTAGACGCGCCAAGTCCGGCGCAGAGGAAGGGAGGGGACACGCGGAGCAGGCCAGGCTCTCAGGAGGCACCGGAATCTCCTAGTCCTGGCTCGCACGGCTCGGGCAAGCCTCGAGATTCGGCGACCCCAAACCACTCCCTGGGTCCCNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN ######################################B9-BFFBB;;/.;.:A;B;[email protected]/////FFAA--9.9/FEFBB;BBDB?FF;;;/.;.9.DF9;99.-@-.DFEFFGGC.FGGGGFFFGGF.0;/9?9?CGBGHGC:/[email protected]>---GGCAC?/CDA1CGGAGGDBCCE?EE?EDG?EFF>A1?GHFGFGCGEG############################## RG:Z:1 NM:i:3 AS:i:222 XS:i:0

    As it is mentionned in the guide: " Note that this can only be applied to cases where the clipped bases occur at the start or end of a read.". Is it a strict "or"?

    Thanks for your help!

    Best,

    Antony

  • Oups... I forgot to mention the command:
    java -jar $GATK -T ClipReads -R $REF -I my.bam -o my.clipped.bam -QT 2 -CR SOFTCLIP_BASES
    Thanks!

  • Geraldine_VdAuweraGeraldine_VdAuwera Cambridge, MAMember, Administrator, Broadie admin

    Hi @antonylebechec‌,

    Actually the tool is not quite meant to do what you are trying to do. As implemented it doesn't really clip all bases below a certain threshold. Instead, it keeps a running sum and sets the clipping point to where the running sum exceeds the threshold after subtracting the qual for each base. And it only traverses from the end of the read (depending on read orientation). So in brief, this is a tool to hard clip bad read ends from the sequencer (meaning, the last few cycles) in case the sum of their qualities is not large enough.

    We are considering adding in the functionality that you want but it's not a priority so I can't tell you when it will happen, sorry.

Sign In or Register to comment.