The current GATK version is 3.3-0

#### Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Powered by Vanilla. Made with Bootstrap.

# ClipReads last bases

Posts: 2Member

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:

## Answers

• Posts: 2Member

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

• Posts: 6,973Administrator, GATK Developer 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

Geraldine Van der Auwera, PhD

• Posts: 2Member

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;??EFF=9-@.B/////FFAA--9.9/FEFBB;BBDB?FF;;;/.;.9.DF9;99.-@-.DFEFFGGC.FGGGGFFFGGF.0;/9?9?CGBGHGC:/CBFHE.CCA-GD@C-C->---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;??EFF=9-@.B/////FFAA--9.9/FEFBB;BBDB?FF;;;/.;.9.DF9;99.-@-.DFEFFGGC.FGGGGFFFGGF.0;/9?9?CGBGHGC:/CBFHE.CCA-GD@C-C->---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;??EFF=9-@.B/////FFAA--9.9/FEFBB;BBDB?FF;;;/.;.9.DF9;99.-@-.DFEFFGGC.FGGGGFFFGGF.0;/9?9?CGBGHGC:/CBFHE.CCA-GD@C-C->---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

• Posts: 2Member

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!

• Posts: 6,973Administrator, GATK Developer 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.

Geraldine Van der Auwera, PhD

Sign In or Register to comment.