Created
April 12, 2018 05:35
-
-
Save cyklee/72f183f645ade533037204d54220ad13 to your computer and use it in GitHub Desktop.
Converts GFF file from Prokka to GTF for htseq-count
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
infile=$1 | |
if [ "$infile" == "" ] ; then | |
echo "Usage: prokkagff2gtf.sh <PROKKA gff file>" | |
exit 0 | |
fi | |
grep -v "#" $infile | grep "ID=" | cut -f1 -d ';' | sed 's/ID=//g' | cut -f1,4,5,7,9 | awk -v OFS='\t' '{print $1,"PROKKA","CDS",$2,$3,".",$4,".","gene_id " $5}' | |
# Use indexed & sorted bam file from anvi-init-bam (or default outut from samtools sort) | |
# htseq-count -r pos -t CDS -f bam Sample01_indexed.bam test.gtf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment