Created
July 21, 2022 16:34
-
-
Save opplatek/70db00079a05a8cb94d08c3d2a2fcd80 to your computer and use it in GitHub Desktop.
Reformat RNA FASTA to DNA FASTA for reference
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 | |
# | |
# Get miRBase hairpin FASTA (multiline, with U instead of T) and reformat it to "normal" reference FASTA | |
# | |
wget ftp://mirbase.org/pub/mirbase/21/hairpin.fa.gz # Get the sequence | |
zcat hairpin.fa.gz | perl -pe '/^>/ ? print "\n" : chomp' \ | |
| tail -n +2 | sed '/^[^>]/ y/uU/tT/' \ | |
> hairpin.oneline.fasta # Convert to one-line fasta and replace all Us for Ts | |
grep -A1 "^>hsa" hairpin.oneline.fasta | sed '/^--$/d' \ | |
> hsa_hairpin.fasta # Get only human hairpin sequences |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment