Skip to main content
9 votes

Delete all 4 lines of a fastq read from a fastq file using read ID

Don't do it: Your FASTQ file is either malformed or your FASTQ record spans more than four lines, which is allowed in FASTQ. For a detailed description of what can go wrong in FASTQ parsing see for ...
winni2k's user avatar
  • 2,286
8 votes
Accepted

Calculating read average length in a Fastq file with bioawk/awk

This can also be done with regular awk. awk '{if(NR%4==2) {count++; bases += length} } END{print bases/count}' <fastq_file> The ...
Bioathlete's user avatar
  • 2,574
6 votes

Delete all 4 lines of a fastq read from a fastq file using read ID

If you are 100% sure the read only has 4 lines (they can have more), you can use this sed command: ...
terdon's user avatar
  • 10.2k
5 votes
Accepted

bioawk removed part of FASTQ header

bioawk -cfastx 'length($seq) > 1 {print "@"$name $comment"\n"$seq"\n+\n"$qual}' in.fq.qz | gzip > out.fq.qz Note the addition of ...
Devon Ryan's user avatar
  • 19.7k
5 votes

Selecting sites from VCF which have an alt AD > 10

using vcfilterjs and the following script: ...
Pierre's user avatar
  • 1,536
5 votes
Accepted

What kind of "gff" format does bioawk parse?

I would consider the description there a bug. The filter is actually the strand, strand is the frame, ...
Devon Ryan's user avatar
  • 19.7k
4 votes

Selecting sites from VCF which have an alt AD > 10

You can do this in Hail: ...
Cotton Seed's user avatar
4 votes
Accepted

Selecting sites from VCF which have an alt AD > 10

This now works with the development version of Bcftools v1.5 (commit 4f134df). Thanks to Petr Danecek for adding the feature. I expect this feature to make its way into the next release of Bcftools: <...
winni2k's user avatar
  • 2,286
4 votes
Accepted

Intersecting two different files with one "master" file based on different columns

An awk solution ...
glenn jackman's user avatar
3 votes

filter out FASTQ reads which are shorter

You need to use variable $seq. For example: ...
user172818's user avatar
  • 6,545
3 votes

Delete all 4 lines of a fastq read from a fastq file using read ID

When I can I like to do file processing line-by-line in the spirit of UNIX tools. You can read 4 lines from a Fastq file into 4 tab-separated values on a single line using ...
Daniel Standage's user avatar
3 votes

Using column 2 of one file to match with two columns of another file, and append

Pipe a modified form of the second file to BEDOPS bedmap and the first file, then pipe that result to cut out desired columns: ...
Alex Reynolds's user avatar
3 votes

Calculating read average length in a Fastq file with bioawk/awk

This script is wrong because a quality string may start with @. With bioawk, it can be simplified to: ...
user172818's user avatar
  • 6,545
2 votes
Accepted

Splitting characters of a column in repeated lines and reducing them to one line

OK. This is a bit convoluted, but it works. There might be simpler solutions... First we'll write a function that takes a data frame and a character position (ie; first or second position in the ...
heathobrien's user avatar
  • 1,816
1 vote

Find pattern that is present twice and allow <=2 mismatches on each

This isn't perfect but you can build on it to deal with any issues (ie overalpping hits). Also if you need it faster just chunk it and run in parallel threads. I just copy pasted your examples seqs ...
Liam McIntyre's user avatar
1 vote

Delete all 4 lines of a fastq read from a fastq file using read ID

Here's an awk one-liner that works as intended, unlike the bioawk answer. This removes all instances of fastq records in which ...
conchoecia's user avatar
  • 3,181
1 vote

Using column 2 of one file to match with two columns of another file, and append

Here's one approach in Perl. Note that I have not tested this extensively, and I am not confident it works. Please test first and let me know if there are problems. ...
terdon's user avatar
  • 10.2k

Only top scored, non community-wiki answers of a minimum length are eligible