Hi team, I am seeking advice on how is the best so...
# modules
l
Hi team, I am seeking advice on how is the best solution to the problem we are having in smrnaseq with fastp module. There are protocols that will need to trim N nucleotides at the end of the read. Fastp has a parameter for that, but it does that before adapter trimming, so it is not useful. I don't know if we could add another module for this specific case, or somehow adapt the script in fasp to do a second round of trimming when this parameter is on (
trim_tail1
) . Normally the parameter would be set up with
task.ext.args
..., if somebody has some elegant way to do this, let me know.
p
I'm pretty sure that cutadapt has the option to do this
ok maybe not, same issue. See workaround and issue.
I think I remember doing the
N
trick in the past ๐Ÿค”
So that it looks for the adapter sequence, followed by 4 bases
Though that may not trim off the 4 bases if no adapter sequence is found
l
yes, with cutadapt we could do NNNN, but It seems with fastp is not an option, I can talk to smrnaseq devs to see if it is worth to go back to cutadapt, but everybody was supporting the idea of fastp
p
Is it worth asking the fastp devs?
l
there is an issue open as well
they said they will consider, I can ping them
๐Ÿ‘๐Ÿป 1
but the issues has been open for a while, not sure it is under their priority
what do you think is better? a new module only for this case or make fastp code more complex? I am afraid that some people would want to trim before adapter some how, so I was thinking new module...
s
If you need to make a local module that calls fastp twice, that is fine
๐Ÿ‘๐Ÿป 1
(or a patch for the modules repo version)
l
ok, i am doing the local module for now, thanks
p
Might be nicer to patch if you're just appending a string to the command? Then you'll still be able to update when new versions are available etc, rather than having to remember to update yourself manually.
l
it won't be just a string though, i will need to add code to run twice fastp, and there is already three type of running there
and that module is using symlinks for input/output, I couldn't figure out how to add it nicely
p
Fair enough ๐Ÿ‘๐Ÿป oof yeah it's pretty complex already
m
You can call the same module multiple times using aliases, though? No need to make separate implementations for it, I think?
p
True, just run the module twice.. Would mean a larger intermediate file footprint though, as can't stream
m
BBDuk would have a
tp=
parameter:
(trimpad) Trim this much extra around matching kmers.
, so you could trim the adapters plus N bases in one go.
๐Ÿ‘ 1
l
I tried to run the module twice, but it is working with symlinks and it was not working, or I couldn't make it work
m
One thing that came to my mindโ€ฆcanโ€™t you instead of changing the tool or its arguments create a modified
adapter.fasta
adding the additional bases to the adapter sequences?
p
4^4 - 256 adapters. Not sure if that would slow down the trimming, looking for so many sequences? ๐Ÿค”
I guess that's basically the same as adding 4 Ns though right?
m
I think that is too pessimistic: The tool may outright support adapter sequences with Ns and allow for mismatches (also because of sequencing errors). I think it depends on the kmer index length how many more kmer sequences you will actually create from those highly similar references.