Untitled

mail@pastecode.io avatar
unknown
plain_text
3 years ago
1.2 kB
1
Indexable
Never
for file in ls *.temp
do
        echo "Now Processing $file"
        # Find lines that begin with numbers
        awk '{ if ($1 ~ /^[0-9]/) print $1}' $file > temp_holding.tmp
                # if lines found, truncate $file to ID and add entries to gff
                if [ ! -s temp_holding.tmp ];
                        then
                                echo "No predicted genes found";
                        else
                                echo "Predicted Genes being processed";
                                prefix=$(echo $file | sed 's/_length.*//')
                                while read line
                                do
                                        # $line contains the ID number we should parse out of $file
                                        # need to truncate $file
                                        ID=$(echo $file | sed 's/_length.*//')                                  
                                        grep "^$line" $file | awk '{print $0}' | awk -v ID="$ID" \
                                        '{print ID, "glimer", "CDS", $4, $5, $9, $2, ".", "."}' >> final.gff
                                done < temp_holding.tmp
                fi
done