Results for "awk"

Wire posts

  • zcat input_file.fastq.gz | awk 'NR%4==1{printf ">%s\n", substr($0,2)}NR%4==2{print}' > output_file.fa #fastaQ2fasta #fastaq #fasta #Oneliner

    3609 days ago

  • Count the contigs length in index fasta file with samtools. $ awk '{s+=$2}END{print s}' scaffolds.fasta.fai #Fasta #Index #Length #Count #Size #Samtools

    2107 days ago

  • Sort FASTA sequence by length: cat f1.fasta| awk '{if($0 ~ /^>/){printf "%st", $0}else{print length($0)"t"$0}}'| sort -k2n,2| awk '{print $1"n"$3}' > sequence.fasta #Sort #Fasta #Trick #Onliner

    3151 days ago

  • Print all the values beetween a pattern "abc" > awk '/abc/{flag=1;next}/mno/{flag=0}flag' file #awk #print #range #pattern

    2971 days ago

  • #BAM file to fasta #conversion with #Samtool: samtools view filename.bam | \ awk '{OFS="\t"; print ">"$1"\n"$10}' - > filename.fasta

    2928 days ago

  • #BAM file to #fastaq #conversion with #Samtool: samtools view filename.bam | awk '{OFS="\t"; print "@"$1"\n"$10"\n+\n"$11}' >| filename.fastq

    2928 days ago

  • Grep all the processor in Linux system $ grep "^processor" /proc/cpuinfo | tail -n 1 | awk '{print $3}' #Grep #OS #Linux #Processor

    2844 days ago

  • #Extract #tabbed info from #BAM file with samtools: samtools view test.bam|awk '{print $1 "\t" $2 "\t" $3 "\t" $4 "\t" $4+length($10)-1}' > file.xls

    2835 days ago

  • #Extract #Chromosome #Number And Start Position #Reads: samtools view bamfile.bam|awk '{print $3 "\t" $4 "\t" $4+length($10)-1}' > newfile.tab

    2829 days ago

  • Extract reference nucleotide from BAM file: samtools view your.bam | awk '{print substr( $10, 100, 1)}' #SAM #BAM #Samtools #Tricks #NGS

    2829 days ago