Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • calcultate Max, min of contigs length

    Hi Everyone
    I want to calculate max, min length of contig file. but i dont know about perl, and i want to mems share script in perl to calculate max, min.
    Thanks.

  • #2
    HMMER ships with some excellent little sequence analysis/conversion/etc. tools. I think for this task esl-seqstat would be perfect..
    savetherhino.org

    Comment


    • #3
      There is an awk script example on http://www.researchgate.net/post/Ful...ng_contig_file that should produce the info you need. You will have to run it on a unix system and on command line.

      Comment


      • #4
        Originally posted by GenoMax View Post
        There is an awk script example on http://www.researchgate.net/post/Ful...ng_contig_file that should produce the info you need. You will have to run it on a unix system and on command line.
        Can you more explained for me? or Is there a software for it
        Last edited by Votinhkiem90; 09-28-2013, 06:46 AM.

        Comment


        • #5
          Originally posted by Votinhkiem90 View Post
          Can you more explained for me?
          I assume you have access to a computer running linux/unix? If you do not then the following will not work.

          In a terminal window run the following command while you are in the directory where you contig file is (in multi-FASTA format). Command reproduced here from the original link in post #3.

          Code:
          $ awk 'BEGIN{flag=0;print "Contig ID\tContig Length\tA\tT\tG\tC\tN\tOtherCharacters"}{if($0~/^>/){if(flag==1){tot=aCount+tCount+gCount+cCount+nCount+xCount;print id"\t"tot"\t"aCount"\t"tCount"\t"gCount"\t"cCount"\t"nCount"\t"xCount;}id=$0;flag=1;aCount=gCount=cCount=tCount=nCount=xCount=0;}else{aCount+=gsub(/[aA]/,"A",$0);tCount+=gsub(/[tT]/,"T",$0);gCount+=gsub(/[gG]/,"G",$0);cCount+=gsub(/[cC]/,"C",$0);nCount+=gsub(/[nN]/,"N",$0);xCount+=gsub(/[^ATGCNatgcn]/,"X",$0);}}END{tot=aCount+tCount+gCount+cCount+nCount+xCount;print id"\t"tot"\t"aCount"\t"tCount"\t"gCount"\t"cCount"\t"nCount"\t"xCount;}' INPUT_FILE >OUTPUT_FILE
          Replace the INPUT_FILE with your contig file name. Replace OUTPUT_FILE with a file name you want to use for the result.

          Comment


          • #6
            Originally posted by GenoMax View Post
            I assume you have access to a computer running linux/unix? If you do not then the following will not work.

            In a terminal window run the following command while you are in the directory where you contig file is (in multi-FASTA format). Command reproduced here from the original link in post #3.

            Code:
            $ awk 'BEGIN{flag=0;print "Contig ID\tContig Length\tA\tT\tG\tC\tN\tOtherCharacters"}{if($0~/^>/){if(flag==1){tot=aCount+tCount+gCount+cCount+nCount+xCount;print id"\t"tot"\t"aCount"\t"tCount"\t"gCount"\t"cCount"\t"nCount"\t"xCount;}id=$0;flag=1;aCount=gCount=cCount=tCount=nCount=xCount=0;}else{aCount+=gsub(/[aA]/,"A",$0);tCount+=gsub(/[tT]/,"T",$0);gCount+=gsub(/[gG]/,"G",$0);cCount+=gsub(/[cC]/,"C",$0);nCount+=gsub(/[nN]/,"N",$0);xCount+=gsub(/[^ATGCNatgcn]/,"X",$0);}}END{tot=aCount+tCount+gCount+cCount+nCount+xCount;print id"\t"tot"\t"aCount"\t"tCount"\t"gCount"\t"cCount"\t"nCount"\t"xCount;}' INPUT_FILE >OUTPUT_FILE
            Replace the INPUT_FILE with your contig file name. Replace OUTPUT_FILE with a file name you want to use for the result.
            Thank all, How to sort to max to min lengthcontigs?

            Comment


            • #7
              Originally posted by Votinhkiem90 View Post
              Thank all, How to sort to max to min lengthcontigs?
              Assume you ran GenoMax's awk code to create the output. In that case the following would sort the contigs based on their length.
              Code:
              sort -t $'\t' -k2 -n -r INPUT_FILE > OUTPUT_FILE

              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, Yesterday, 08:47 AM
              0 responses
              12 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-11-2024, 12:08 PM
              0 responses
              60 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-10-2024, 10:19 PM
              0 responses
              59 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 04-10-2024, 09:21 AM
              0 responses
              54 views
              0 likes
              Last Post seqadmin  
              Working...
              X