Seqanswers Leaderboard Ad

Collapse

Announcement

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

  • Command for getting a fragment from a sequence file

    Hi all,

    Could anyone tell me how to get from a sequence file the sequence which is delimited from certain positions? As an example:

    Original file:

    asdfgh
    qwert


    Get sequence from positions 2 to 8:

    I tried the following:

    cat original.txt | cut -c 2-8 >result file

    Result file:

    sdfgh
    wert

    Instead of that I would like to obtain:

    sdfghqwe

    Can anyone help me?

  • #2
    How long are the actual sequences you are working with?

    It looks like your command would work if your sequence was all on one line.

    Comment


    • #3
      Originally posted by mastal View Post
      How long are the actual sequences you are working with?

      It looks like your command would work if your sequence was all on one line.
      You are right mastal, the command works if my sequence is all on one line, the problem is that sometimes it´s not.

      Actually my sequences are contigs with about 235000 nucleotides...

      Comment


      • #4
        Consider tr command

        tr -d "\n" to eliminate carriage returns.

        Example:
        cat file | tr -d "\n" | cut -b1-7

        Comment


        • #5
          Seqret from Emboss package can handle it:
          seqret input.fasta -sbegin -send

          Comment


          • #6
            # Richard This could be an option thanks!!

            # TiborNagy I just installed the Emboss package run your command and your option is just what I was looking for. thank you very much!!!

            Comment


            • #7
              Try this

              cat original.txt | sed 's/\n//g' | cut -c 2-8 >result file

              OR

              Other option will be, you can parse your BED file through this command with a simple perl or bash script.
              fastacmd -d input.fasta -s Chromosome -L start,stop

              Download fastacmd linux binary from here. Because in new BLAST tool this has been replace by blastdbcmd which does not supports this and not available in NCBI website.
              Last edited by santhilalsubhash; 02-12-2014, 01:28 PM.

              Comment

              Latest Articles

              Collapse

              • seqadmin
                Recent Innovations in Spatial Biology
                by seqadmin


                Spatial biology is an exciting field that encompasses a wide range of techniques and technologies aimed at mapping the organization and interactions of various biomolecules in their native environments. As this area of research progresses, new tools and methodologies are being introduced, accompanied by efforts to establish benchmarking standards and drive technological innovation.

                3D Genomics
                While spatial biology often involves studying proteins and RNAs in their...
                Yesterday, 07:30 PM
              • seqadmin
                Advancing Precision Medicine for Rare Diseases in Children
                by seqadmin




                Many organizations study rare diseases, but few have a mission as impactful as Rady Children’s Institute for Genomic Medicine (RCIGM). “We are all about changing outcomes for children,” explained Dr. Stephen Kingsmore, President and CEO of the group. The institute’s initial goal was to provide rapid diagnoses for critically ill children and shorten their diagnostic odyssey, a term used to describe the long and arduous process it takes patients to obtain an accurate...
                12-16-2024, 07:57 AM

              ad_right_rmr

              Collapse

              News

              Collapse

              Topics Statistics Last Post
              Started by seqadmin, 12-30-2024, 01:35 PM
              0 responses
              26 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 12-17-2024, 10:28 AM
              0 responses
              41 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 12-13-2024, 08:24 AM
              0 responses
              56 views
              0 likes
              Last Post seqadmin  
              Started by seqadmin, 12-12-2024, 07:41 AM
              0 responses
              41 views
              0 likes
              Last Post seqadmin  
              Working...
              X