Unconfigured Ad

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • veena
    replied
    Thats what I get for not readig the manual well enough thanks krobison! And disclaimer duly noted!
    Last edited by veena; 06-03-2010, 12:38 PM. Reason: being an idiot!

    Leave a comment:


  • krobison
    replied
    Using Picard's tool is probably better, but it's worth studying the line below as an example as an example of a very quick-and-dirty SAM-to-FASTA generator

    Code:
    samtools view myalign.bam | perl -n -e 'if (/^\@/) { @f=split(/\t/); print ">$f[0]|$f[1] $f[2]:$f[3]\n$f[9]\n"; }'

    I used the flag field to disambiguate the two ends of a read

    (any bugs were clearly deliberate attempts to educate the student! :-)

    Leave a comment:


  • veena
    replied
    Thanks Nils, I'll give it a try!

    Leave a comment:


  • nilshomer
    replied
    Originally posted by veena View Post
    Thanks so much again Nils! The scary thought is I'm the "local bioinformatician" and I've googled my fingers silly trying to figure out how to get a fasta (thats all I really need!) from the publicly available .bam file. Nobody else around me cares to work with .bam files (yet). Is it best to convert from bam to sam and then format read name and sequence into fasta? Or is there a better way?
    Look at Picard's SamToFastq.jar. That will get you to FASTQ and then smooth sailing to FASTA. Alternatively, you can use the many APIs (PERL, Python, C, Java, etc.) to natively read in SAM/BAM. I have personally used all of them successfully.
    Last edited by nilshomer; 03-03-2010, 08:55 PM. Reason: speak and spell failed

    Leave a comment:


  • veena
    replied
    Thanks so much again Nils! The scary thought is I'm the "local bioinformatician" and I've googled my fingers silly trying to figure out how to get a fasta (thats all I really need!) from the publicly available .bam file. Nobody else around me cares to work with .bam files (yet). Is it best to convert from bam to sam and then format read name and sequence into fasta? Or is there a better way?

    Leave a comment:


  • nilshomer
    replied
    Originally posted by veena View Post
    Thanks Nils!
    Another newbie question, I'm trying to get a subset of reads from publicly available unmapped data that align to my sequence of interest.

    I'm told that a read's sequence should be available in a BAM file. But isnt a BAM file by definition an alignment file (as in aligned-to-something file) to begin with? Can I run another alignment program (say Blast) on a pre-existing BAM file with a completely different query? Very confused and would appreciate any help!
    The SAM format has support for reads that are not aligned. For example, if one end of a paired end read does not map, it can be flagged as unmapped and given the co-ordinate of the other end. I would study the SAM spec carefully. By filtering on the FLAG field, you can pull out reads that are unmapped (assuming that the aligner was kind enough to include unmapped reads).

    To run BLAST on a BAM file, you would have to convert the BAM file into whatever format (FASTA?) BLAST requires. This can be done with a quick script or bugging your local bioinformatician.

    Leave a comment:


  • veena
    replied
    Also, any help on how to run BLAST on a BAM file would be much appreciated!

    Leave a comment:


  • veena
    replied
    Thanks Nils!
    Another newbie question, I'm trying to get a subset of reads from publicly available unmapped data that align to my sequence of interest.

    I'm told that a read's sequence should be available in a BAM file. But isnt a BAM file by definition an alignment file (as in aligned-to-something file) to begin with? Can I run another alignment program (say Blast) on a pre-existing BAM file with a completely different query? Very confused and would appreciate any help!

    Leave a comment:


  • nilshomer
    replied
    Originally posted by veena View Post
    Hi,

    I downloaded a bam file from NCBI and am unable to index it. Here is what I've done:
    samtools index file.bam

    Error message:
    [bam_header_read] EOF marker is absent.

    I haven't really found anything in thread archives that give this error with a bam file so am pretty sure I'm doing something fundamentally wrong. I'm a samtools and bam file newbie so any help would be much appreciated!

    Thanks!
    Your fine as it is just a warning. The new implementations of samtools and picard add an EOF marker. Earlier BAMs did not have these.

    Nils

    Leave a comment:


  • veena
    started a topic Error indexing BAM file using samtools

    Error indexing BAM file using samtools

    Hi,

    I downloaded a bam file from NCBI and am unable to index it. Here is what I've done:
    samtools index file.bam

    Error message:
    [bam_header_read] EOF marker is absent.

    I haven't really found anything in thread archives that give this error with a bam file so am pretty sure I'm doing something fundamentally wrong. I'm a samtools and bam file newbie so any help would be much appreciated!

    Thanks!

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, Yesterday, 11:13 AM
0 responses
17 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, Yesterday, 10:48 AM
0 responses
18 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, 10-15-2026, 10:52 AM
0 responses
36 views
0 reactions
Last Post SEQadmin2  
Started by SEQadmin2, 10-14-2026, 05:39 AM
0 responses
42 views
0 reactions
Last Post SEQadmin2  
Working...