163
votes
Accepted
Why does the SARS-Cov2 coronavirus genome end in aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa (33 a's)?
Good observation! The 3' poly(A) tail is actually a very common feature of positive-strand RNA viruses, including coronaviruses and picornaviruses.
For coronaviruses in particular, we know that the ...
62
votes
Accepted
What is the difference between FASTA, FASTQ, and SAM file formats?
Let’s start with what they have in common: All three formats store
sequence data, and
sequence metadata.
Furthermore, all three formats are text-based.
However, beyond that all three formats are ...
49
votes
Accepted
Why does the FASTA sequence for coronavirus look like DNA, not RNA?
That is the correct sequence for 2019-nCov. Coronavirus is of course an RNA virus and in fact, to my knowledge, every RNA virus in Genbank is present as cDNA (AGCT, i.e. thydmine) and not RNA (AGCU, i....

M__♦
- 11.9k
32
votes
Why does the SARS-Cov2 coronavirus genome end in aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa (33 a's)?
This question is quite general, so I'm going to attempt to tie it back to bioinformatics.
Background
The tree for the current coronavirus is here, showing it is closely related to bat-coronavirus and ...

M__♦
- 11.9k
29
votes
Accepted
Uppercase vs lowercase letters in reference genome
What does this soft masking actually mean?
A lot of the sequence in genomes are repetitive. Human genome, for example, has (at least) two-third repetitive elements.[1].
These repetitive elements ...
26
votes
Accepted
What is the fastest way to calculate the number of unknown nucleotides in FASTA / FASTQ files?
For FASTQ:
seqtk fqchk in.fq | head -2
It gives you percentage of "N" bases, not the exact count, though.
For FASTA:
...
21
votes
Why does the SARS-Cov2 coronavirus genome end in aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa (33 a's)?
Some of the other answers here seem quite good; at the same time I think the core answer to the OP's question is maybe a bit hard to tease out of them, so I'd like to try to state it more plainly. It'...
20
votes
What is the difference between FASTA, FASTQ, and SAM file formats?
In a nutshell,
FASTA file format is a DNA sequence format for specifying or representing DNA sequences and was first described by Pearson ...
20
votes
Accepted
Read length distribution from FASTA file
If you want something quick and dirty you could rapidly index the FASTA with samtools faidx and then put the lengths column through R (other languages are available)...
18
votes
What is the fastest way to calculate the number of unknown nucleotides in FASTA / FASTQ files?
5 hours and no benchmarks posted? I am sorely disappointed.
I'll restrict the comparison to just be fasta files, since fastq will end up being the same. So far, the contenders are:
R with the ...
15
votes
How to convert FASTA to BED
You can do this easily with bioawk, which is a version of awk with added features facilitating bioinformatics:
...
13
votes
Uppercase vs lowercase letters in reference genome
The use of lower/upper case letters and N/n letters in genomes sequences is not completely standardised and you should always ...
13
votes
What Ensembl genome version should I use for alignments? (e.g. toplevel.fa vs. primary_assembly.fa)
There's rarely a good reason to use a hard-masked genome (sometimes for blast, but that's it). For that reason, we use soft-masked genomes, which only have the benefit of showing roughly where repeats ...
13
votes
Accepted
How to convert fasta file to tab delimited file
If you have multi-line fasta files, as is very common, you can use these scripts1 to convert between fasta and tbl (sequence_name <TAB> sequence) format:
...
13
votes
Why does the SARS-Cov2 coronavirus genome end in aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa (33 a's)?
Not an expert, but some searching on eukaryotic positive-strand RNA viruses seems to show that polyadenylation is not uncommon. For example, Steil, et al., 2010.
12
votes
Read length distribution from FASTA file
Statistics for nanopore reads are tricky because of the huge range of read lengths that can be present in a single run. I have found that the best way to display lengths is by using a log scale on ...
12
votes
How to convert FASTA to BED
It's good practice to have your FASTA indexed, so you can leverage the .fai you are likely to already have. If not, you can just ...
12
votes
How to convert fasta file to tab delimited file
There is a very simple BioPython solution, that is minimal, readable, and handles multi-line fasta:
...
11
votes
Accepted
Changing the record id in a FASTA file using BioPython
If I use SeqIO.parse(filehandle, 'fasta') to parse a FASTA file, then it will return a SeqRecord object where the ...
10
votes
Accepted
How do I rename fasta headers?
Why not use sed instead?
sed -e 's/chr_I/I/' -e 's/chr_V/V/' -e 's/chr_X/X/' mySequence.fasta > mySeq.fasta
Or even ...
10
votes
Accepted
How to download FASTA sequences from NCBI using the terminal?
Alternatively, you can use the NCBI Entrez Direct UNIX E-utilities
Basically, you have to download the install file here: https://www.ncbi.nlm.nih.gov/books/NBK179288/bin/install-edirect.sh
In the ...
10
votes
Removing duplicate FASTA sequences based on headers with Bash
If you want to avoid using extra libraries for any reason, you can just use a simple Python script (version 3.6 and above) to do this:
...
9
votes
What is the fastest way to calculate the number of unknown nucleotides in FASTA / FASTQ files?
I think that this should be pretty fast:
FASTA:
grep -v "^>" seqs.fa | tr -cd N | wc -c
FASTQ:
...
9
votes
Accepted
What Ensembl genome version should I use for alignments? (e.g. toplevel.fa vs. primary_assembly.fa)
Generally, you should use the soft-masked or unmasked primary assembly. Cross-species whole-genome aligners, especially older ones, do need to know soft-masked regions; otherwise they can be ...
9
votes
Accepted
How to extract fasta from a blastdb
You can extract fasta sequence from a blastdb constructed from a fasta file using blastdbcmd which should be installed when you install blast/makeblastdb.
...
9
votes
Can FASTA files have nucleotide and protein sequences within them; or must they only have 1 type?
While there's nothing stopping anyone from doing that with the FASTA format (after all, it's just a text file with '>' defining header lines), I don't know of any software that would support such a ...
9
votes
How to convert fasta file to tab delimited file
assuming there is only one sequence line per record, use paste with two 'stdin'
cat your.fasta | paste - -
9
votes
Accepted
Splitting fasta file into smaller files based on header pattern
Here's a simple awk approach:
awk '{if(/^>/){split($1,a,"[|.]")}print >> a[2]".fa"}' Protein_FASTA.txt
Or, more concisely, just:
...
9
votes
Removing duplicate FASTA sequences based on headers with Bash
You can use seqkit for this purpose.
seqkit rmdup -n seqs.fa -o seqs_without_duplicate.fa
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
fasta × 235phylogenetics × 49
python × 47
phylogeny × 27
sequence-alignment × 23
r × 17
sequence-analysis × 12
samtools × 12
ngs × 12
bash × 12
genome × 11
awk × 11
proteins × 10
fastq × 10
linux × 10
file-formats × 9
format-conversion × 9
blast × 8
sam × 8
shell × 8
assembly × 7
covid-19 × 7
grep × 7
pdb × 6
database × 5