Skip to content

Conversation

@arq5x
Copy link

@arq5x arq5x commented Dec 28, 2011

Hi Heng,

I forked your nice -c addition to nawk and added support for pre-defined genomics formats. This allows one to use named columns in nawk without a header line. It changes the behavior of the -c option in that you must specify a "type" (e.g., bed, vcf, sam, etc.). If you just want to use a header line (your original behavior), you use "-c header".

examples:

awk -c header '$start > 11000' test.bed
awk -c bed '$start > 11000' test-noheader.bed
samtools view aln.bam | awk -c sam '$mapq > 60'
samtools view aln.bam | awk -c sam 'and($flag, 2) == 0'
awk -c vcf '$id != "."' test.vcf

Let me know what you think. One idea I had in doing this was that it would be really nice to support zlib compressed files and streams so that this might work with BAM, tabix, etc.

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

Successfully merging this pull request may close these issues.

1 participant