Skip to content

Instantly share code, notes, and snippets.

@pgonzale60
Created March 7, 2024 20:51
Show Gist options
  • Save pgonzale60/95fffe11878fa41dd355e397b41e7394 to your computer and use it in GitHub Desktop.
Save pgonzale60/95fffe11878fa41dd355e397b41e7394 to your computer and use it in GitHub Desktop.
Run tandem repeat finder and convert the output to TSV
ln -s $assembly ${strain}.fasta
$trf_cmd ${strain}.fasta 2 7 7 80 10 50 2000 -f -h -d -m
rm ${strain}.fasta
mv ${strain}.fasta.2.7.7.80.10.50.2000.dat ${strain}.trf.dat
mv ${strain}.fasta.2.7.7.80.10.50.2000.mask ${strain}.trf.mask
grep -P '^[S0-9]' ${strain}.trf.dat | cut -d ' ' -f 1,2,3,4,6,7,8,13,14 | awk '{if(\$1 ~ /Sequence/){chr=\$2} else {print chr, \$0}}' | tr [:blank:] '\t' > ${strain}.trf.tsv
rm ${strain}.fasta
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment