tracy icon indicating copy to clipboard operation
tracy copied to clipboard

[feature request] Further options to control trimming with consensus

Open blex-max opened this issue 2 years ago • 5 comments

Would it be possible to implement a trim option to take a set number of bases after an initial trim threshold? e.g. for a sequence:

ACTGATCTACTAGATCCC

-q 5 -'crop' 10

we get:

~~ACTGA~~ TCTACTAGAT ~~CCC~~

Does that make sense? Thanks!

blex-max avatar May 11 '22 10:05 blex-max

Can't you easily do this by simply using the length of the sequence to calculate the required right trimming size? E.g.:

tracy basecall -o out.fa -f fasta in.ab1 tail -n 1 out.fa | awk '{print length($1);}'

and then you do length - desired_left_trim - desired_length for the right trimming size?

tobiasrausch avatar May 11 '22 12:05 tobiasrausch

It seems convoluted (and computationally slow) to me to basecall the sequence, check the length, then use that length to feed into basecalling the same sequence again - but I suppose I could indeed do that!

blex-max avatar May 11 '22 13:05 blex-max

But to be clear I do still think it would be useful to have this be an internal feature

blex-max avatar May 11 '22 20:05 blex-max

Can't you easily do this by simply using the length of the sequence to calculate the required right trimming size? E.g.:

tracy basecall -o out.fa -f fasta in.ab1 tail -n 1 out.fa | awk '{print length($1);}'

and then you do length - desired_left_trim - desired_length for the right trimming size?

Can you give an example for this command? Because I'm interesting in trimming left and right of the sequence

ricardochinchillam avatar Jun 29 '22 17:06 ricardochinchillam

For the consensus sub-command you can just specify the trimming length, i.e.:

tracy consensus --trimLeft1 50 --trimRight1 50 ...

Or do you want such an option for the FASTA output of tracy basecall ?

tobiasrausch avatar Jun 30 '22 07:06 tobiasrausch