Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trim to a specified length #9

Closed
sjackman opened this issue Jun 13, 2013 · 8 comments
Closed

Trim to a specified length #9

sjackman opened this issue Jun 13, 2013 · 8 comments

Comments

@sjackman
Copy link

I'd like to trim a bunch of variable length reads to a fixed length. I read the help page for seqtk trimfq, but didn't see what I was looking for. Could this feature please be added?

@sjackman
Copy link
Author

I found that FASTX-toolkit implements this feature.
http://hannonlab.cshl.edu/fastx_toolkit/commandline.html#fastx_trimmer_usage

   [-f N]       = First base to keep. Default is 1 (=first base).
   [-l N]       = Last base to keep. Default is entire read.

@vsbuffalo
Copy link
Contributor

This would be useful — I'd be happy to implement this and issue a pull request if it'll be incorporated. Note that bioawk can also do this pretty easily:

$ echo ">test-1\\nAGTATCTAGCATATCGT\\n>test-B\\nGCTAGCACGATC" | \
  bioawk -cfastx '{print fastx($name, substr($seq, 0, 10))}' # note this depends on fastx(), a function I implemented
>test-1
AGTATCTAGC
>test-B
GCTAGCACGA

@lh3
Copy link
Owner

lh3 commented Jul 8, 2013

Release 1.0 does not support trimming to fixed length as adding the functionality may affect the stability of trimfq. You may use Vince's script to achieve the goal for now. I will leave the issue open.

@ndaniel
Copy link

ndaniel commented Sep 19, 2014

Actually release 1.0 supports trimming to fixed length!
Just try "seqtk -q 0 -l N input.fq" (it keeps the first N bp)!

@ndaniel
Copy link

ndaniel commented Sep 19, 2014

I have just commited some changes which does all these (i.e. shortcircuiting the q == 0, keep first last N bp).

lh3 added a commit that referenced this issue Apr 5, 2016
@lh3
Copy link
Owner

lh3 commented Apr 5, 2016

Implemented via 46cd37e ... after 3 years. Sorry.

@lh3 lh3 closed this as completed Apr 5, 2016
@sjackman
Copy link
Author

sjackman commented Apr 5, 2016

Thanks, Heng!

@sjackman
Copy link
Author

sjackman commented Apr 5, 2016

Would you please tag a new stable release tagged either 1.1 or 87? The last stable release 1.0 was tagged in 2013. An out-of-date tagged stable release is more confusing than having no tagged stable release at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants