Seqanswers Leaderboard Ad

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • fahmida
    replied
    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

    Leave a comment:


  • Votinhkiem90
    replied
    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?

    Leave a comment:


  • GenoMax
    replied
    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.

    Leave a comment:


  • Votinhkiem90
    replied
    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.

    Leave a comment:


  • GenoMax
    replied
    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.

    Leave a comment:


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

    Leave a comment:


  • Votinhkiem90
    started a topic calcultate Max, min of contigs length

    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.

Latest Articles

Collapse

  • seqadmin
    New Genomics Tools and Methods Shared at AGBT 2025
    by seqadmin


    This year’s Advances in Genome Biology and Technology (AGBT) General Meeting commemorated the 25th anniversary of the event at its original venue on Marco Island, Florida. While this year’s event didn’t include high-profile musical performances, the industry announcements and cutting-edge research still drew the attention of leading scientists.

    The Headliner
    The biggest announcement was Roche stepping back into the sequencing platform market. In the years since...
    03-03-2025, 01:39 PM
  • seqadmin
    Investigating the Gut Microbiome Through Diet and Spatial Biology
    by seqadmin




    The human gut contains trillions of microorganisms that impact digestion, immune functions, and overall health1. Despite major breakthroughs, we’re only beginning to understand the full extent of the microbiome’s influence on health and disease. Advances in next-generation sequencing and spatial biology have opened new windows into this complex environment, yet many questions remain. This article highlights two recent studies exploring how diet influences microbial...
    02-24-2025, 06:31 AM

ad_right_rmr

Collapse

News

Collapse

Topics Statistics Last Post
Started by seqadmin, 03-20-2025, 05:03 AM
0 responses
17 views
0 reactions
Last Post seqadmin  
Started by seqadmin, 03-19-2025, 07:27 AM
0 responses
18 views
0 reactions
Last Post seqadmin  
Started by seqadmin, 03-18-2025, 12:50 PM
0 responses
19 views
0 reactions
Last Post seqadmin  
Started by seqadmin, 03-03-2025, 01:15 PM
0 responses
186 views
0 reactions
Last Post seqadmin  
Working...