Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AndrewRGross
    Member
    • Sep 2013
    • 16

    #1

    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
  • gringer
    David Eccles (gringer)
    • May 2011
    • 845

    #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

    • LeightonP
      Member
      • Feb 2011
      • 29

      #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

      • yzzhang
        Member
        • Jan 2013
        • 67

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

        Comment

        • AndrewRGross
          Member
          • Sep 2013
          • 16

          #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

          • SEQadmin2
            Multiomic Liquid Biopsy: What DNA/RNA Panels Reveal That DNA Alone Can’t
            by SEQadmin2



            Tumors contain complex mixtures of cell populations that evolve in response to treatment and host-specific factors. Tissue biopsies provide only static snapshots of a tumor’s state. But what if we could follow that evolution over time using a minimally invasive technique?

            Liquid biopsies can detect tumor-derived material circulating in the bloodstream, providing a way to study treatment response, detect emerging resistance, and discover new biomarkers. Circulating
            ...
            10-14-2026, 09:55 AM
          • SEQadmin2
            New Genomics Technologies Take Aim at Long-Standing Limits
            by SEQadmin2


            Researchers using sequencing and genomics tools often have to make trade-offs. They can choose between speed or scale, short reads or long-range information, or targeted panels or a view of the whole transcriptome. New technologies that have been released this year are built to address those tough choices.

            We asked six companies the same four questions to learn about their latest products. The new technologies bring a lot to the table, including rethinking sequencing
            ...
            09-28-2026, 10:25 AM

          ad_right_rmr

          Collapse

          News

          Collapse

          Topics Statistics Last Post
          Started by SEQadmin2, 10-22-2026, 11:13 AM
          0 responses
          60 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-22-2026, 10:48 AM
          0 responses
          42 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-15-2026, 10:52 AM
          0 responses
          71 views
          0 reactions
          Last Post SEQadmin2  
          Started by SEQadmin2, 10-14-2026, 05:39 AM
          0 responses
          71 views
          0 reactions
          Last Post SEQadmin2  
          Working...