Seqanswers Leaderboard Ad

Collapse

Announcement

Collapse
No announcement yet.
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I calculate tetranucleotide frequencies?

    I'd like to calculate the tetranucleotide frequencies of my contigs and the bin them based on shared tetranucleotide frequencies. Can anyone recommend a program or script to calculate this, and possibly tools for binning?

    My data is a low-diversity environmental metagenome. It consists of 150 bp paired end Illumina library generated on a HiSeq 2500, aligned in MIRA.

    What I understand so far:
    The occurrence of certain four-base sequences (ATAT, GGCA, TAAC) is not random within an organism, but biased toward certain tetranucleotides. By calculating the frequencies of every possible tetranucleotide, one can group contigs which likely came from the same organism, even though the aligner failed to align them. Once binned in their own file, a repeat alignment run may be able to align these contigs to build longer contigs than those produced in the original run.

    So far, the only publicly available script I've found is this one, however I don't know if I can install it on the computer I'm running computation on:



    I've been using the following sources for guidance:

    Dick, G. J., Andersson, A. F., Baker, B. J., Simmons, S. L., Thomas, B. C., Yelton, a P., & Banfield, J. F. (2009). Community-wide analysis of microbial genome sequence signatures. Genome biology, 10(8), R85. doi:10.1186/gb-2009-10-8-r85

    Lesniewski, R. A., Jain, S., Anantharaman, K., Schloss, P. D., & Dick, G. J. (2012). The metatranscriptome of a deep-sea hydrothermal plume is dominated by water column methanotrophs and lithotrophs. The ISME journal, 6(12), 2257–68. doi:10.1038/ismej.2012.63

  • #2
    I remembered a Rosalind problem about this:



    My "quickie" code to solve that problem was written in Perl:

    Code:
    #!/usr/bin/perl
    use warnings;
    use strict;
    my %merCount = ();
    my @merOrder = ();
    for(my $i = 0; $i < 256; $i++){
        my $mer4 = sprintf("%s%s%s%s",
    		       int($i / 64)%4, int($i / 16)%4, 
    		       int($i /  4)%4, int($i /  1)%4);
        $mer4 =~ tr/0123/ACGT/;
        $merCount{$mer4} = 0;
    		$merOrder[$i] = $mer4;
    }
    open(my $f, "< input.txt");
    my $fastaLabel = <$f>;
    my $seq = "";
    while(<$f>){
    		s/\s+//;
    		$seq .= $_;
    }
    for(my $i = 0; $i < (length($seq)-3); $i++){
    		$merCount{substr($seq, $i, 4)}++;
    }
    my @counts = ();
    for(my $i = 0; $i < 256; $i++){
    		printf("%s - %d\n",$merOrder[$i],$merCount{$merOrder[$i]});
    		push(@counts, $merCount{$merOrder[$i]});
    }
    print(join(" ", @counts)."\n");
    If you don't care about the order and don't want zero counts, then this code simplifies quite a lot.
    Last edited by gringer; 11-06-2013, 11:05 PM.

    Comment


    • #3
      If you can get your sequences into R, then the oligonucleotideFrequency function (which underlies alphabetFrequency/dinucleotideFrequency etc.) may be helpful to you.



      Code:
      oligonucleotideFrequency(yeast1, 4)
      where yeast1 is your DNAString/DNAStringSet.

      Comment


      • #4
        the script "calc.kmerfreq.pl" in the pipeline multi-metagenome assembly: https://github.com/MadsAlbertsen/multi-metagenome can do this job

        Comment


        • #5
          Awesome: each of you have been a big help.

          My current plan is to employ the R script, because the server I'm working on already has R and the associated command line tools installed.

          That Albertsen metagenome guide looks very, very promising too, so I might incorporate whatever tools I can from that.

          Again, thank you all.

          Comment

          Latest Articles

          Collapse

          • seqadmin
            Essential Discoveries and Tools in Epitranscriptomics
            by seqadmin




            The field of epigenetics has traditionally concentrated more on DNA and how changes like methylation and phosphorylation of histones impact gene expression and regulation. However, our increased understanding of RNA modifications and their importance in cellular processes has led to a rise in epitranscriptomics research. “Epitranscriptomics brings together the concepts of epigenetics and gene expression,” explained Adrien Leger, PhD, Principal Research Scientist...
            04-22-2024, 07:01 AM
          • seqadmin
            Current Approaches to Protein Sequencing
            by seqadmin


            Proteins are often described as the workhorses of the cell, and identifying their sequences is key to understanding their role in biological processes and disease. Currently, the most common technique used to determine protein sequences is mass spectrometry. While still a valuable tool, mass spectrometry faces several limitations and requires a highly experienced scientist familiar with the equipment to operate it. Additionally, other proteomic methods, like affinity assays, are constrained...
            04-04-2024, 04:25 PM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by seqadmin, 04-25-2024, 11:49 AM
          0 responses
          19 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 04-24-2024, 08:47 AM
          0 responses
          18 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 04-11-2024, 12:08 PM
          0 responses
          62 views
          0 likes
          Last Post seqadmin  
          Started by seqadmin, 04-10-2024, 10:19 PM
          0 responses
          60 views
          0 likes
          Last Post seqadmin  
          Working...
          X