Hot answers tagged

147 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 ...
user avatar
  • 1,336
56 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 ...
user avatar
46 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....
user avatar
  • 6,977
31 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 ...
user avatar
  • 6,977
26 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 ...
user avatar
24 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: ...
user avatar
  • 5,645
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)...
user avatar
20 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'...
user avatar
18 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 ...
user avatar
  • 309
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 ...
user avatar
  • 19.3k
17 votes

Why does the FASTA sequence for coronavirus look like DNA, not RNA?

Most sequencing experiments, be it Illumina-based next-generation-sequencing or Sanger sequencing uses DNA as template, not RNA. Even if this virus is RNA-based it would be reverse-transcribed prior ...
user avatar
  • 2,706
14 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: ...
user avatar
  • 2,920
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 ...
user avatar
  • 19.3k
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.
user avatar
  • 541
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 ...
user avatar
  • 11.5k
12 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: ...
user avatar
  • 7,957
11 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 ...
user avatar
11 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 ...
user avatar
  • 3,462
11 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: ...
user avatar
  • 3,462
10 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 ...
user avatar
  • 451
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: ...
user avatar
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: ...
user avatar
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 ...
user avatar
  • 11.5k
9 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 ...
user avatar
  • 3,521
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: ...
user avatar
  • 7,957
9 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 ...
user avatar
  • 1,021
9 votes

Edit FASTA header using sed

awk 'BEGIN{FS="::"}{if($1~">"){printf(">%s_%s\n",$2,substr($1,2))}else{print $0}}' input_file.fa > output.fa An explanation of the non-obvious bits: <...
user avatar
  • 19.3k
8 votes

What is the fastest way to calculate the number of unknown nucleotides in FASTA / FASTQ files?

FASTQ As it was pointed out, fastq can be complicated. But in a simple case when you have four lines per record, one possible solution in bash is: ...
user avatar
8 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 ...
user avatar
  • 5,645
8 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. ...
user avatar
  • 302

Only top scored, non community-wiki answers of a minimum length are eligible