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

Added support for pre-defined column defn's (e.g., sam, bed, vcf) #1

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

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