Question: Sequence Logo For Different Alleles Or Generated From Sam/Bam
1
gravatar for Biomonika (Noolean)
6.5 years ago by
State College, PA, USA
Biomonika (Noolean)3.1k wrote:

I have a SAM/BAM file and instead of displaying it in IGV or another browser, I would like to make a sequence logo out of it. My favourite software WebLogo does not support SAM/BAM file as an input (instead it supports CLUSTALW, FASTA, plain flatfile, MSF, NBRF, PIR, NEXUS and PHYLIP)

I would like to avoid parsing SAM file by myself and adding '-' when needed. Do you have any idea if there is already some software that could do such a thing? Thanks a lot.

The second question is about different alleles. I would like to visualize sequences (reads) from each allele with another color. I have found many coloring schemes, but none dividing sequences into groups together with corresponding coloring. Thanks a lot.

sam • 3.4k views
ADD COMMENTlink modified 6.5 years ago by Alex Reynolds29k • written 6.5 years ago by Biomonika (Noolean)3.1k
1
gravatar for Giovanni M Dall'Olio
6.5 years ago by
London, UK
Giovanni M Dall'Olio26k wrote:

There are many tools to convert a SAM file to FASTA:

You should be able to use one of these to convert your alignment to FASTA, and then make use of WebLogo.

ADD COMMENTlink written 6.5 years ago by Giovanni M Dall'Olio26k
1

Almost there:) sam2fasta does what I want except dealing with insertions (I would like to gap reference when insertions are introduced). SamToFastq does not seem to do the alignment.

ADD REPLYlink written 6.5 years ago by Biomonika (Noolean)3.1k

Thank you! I will check how they deal with insertions tomorrow, I am quite curious about that.

ADD REPLYlink written 6.5 years ago by Biomonika (Noolean)3.1k
1
gravatar for Pierre Lindenbaum
6.5 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum124k wrote:

I quickly wrote a java tool sam4weblogo: https://github.com/lindenb/jvarkit#sam4weblogo using the picard library.

enter image description here

$ java -jar dist/sam4weblogo.jar I=path/to/samtools-0.1.18/examples/sorted.bam R=seq1:80-110 2> /dev/null 

>B7_593:4:106:316:452/1
TGTTG--------------------------
>B7_593:4:106:316:452a/1
TGTTG--------------------------
>B7_593:4:106:316:452b/1
TGTTG--------------------------
>B7_589:8:113:968:19/2
TGGGG--------------------------
>B7_589:8:113:968:19a/2
TGGGG--------------------------
>B7_589:8:113:968:19b/2
TGGGG--------------------------
>EAS54_65:3:321:311:983/1
TGTGGG-------------------------
>EAS54_65:3:321:311:983a/1
TGTGGG-------------------------
>EAS54_65:3:321:311:983b/1
TGTGGG-------------------------
>B7_591:6:155:12:674/2
TGTGGGGG-----------------------
>B7_591:6:155:12:674a/2
TGTGGGGG-----------------------
>B7_591:6:155:12:674b/2
TGTGGGGG-----------------------
>EAS219_FC30151:7:51:1429:1043/2
TGTGGGGGGCGCCG-----------------
>EAS219_FC30151:7:51:1429:1043a/2
TGTGGGGGGCGCCG-----------------
>EAS219_FC30151:7:51:1429:1043b/2
TGTGGGGGGCGCCG-----------------
>B7_591:5:42:540:501/1
TGTGGGGGCCGCAGTG---------------
>EAS192_3:5:223:142:410/1
TGGGGGGGGCGCAGT----------------
>B7_591:5:42:540:501a/1
TGTGGGGGCCGCAGTG---------------
>EAS192_3:5:223:142:410a/1
TGGGGGGGGCGCAGT----------------
>B7_591:5:42:540:501b/1
TGTGGGGGCCGCAGTG---------------
>EAS192_3:5:223:142:410b/1
TGGGGGGGGCGCAGT----------------
ADD COMMENTlink modified 6.5 years ago • written 6.5 years ago by Pierre Lindenbaum124k
1

Pierre, you are definitely Tolkien of bioinformatics! Thanks.

ADD REPLYlink written 6.5 years ago by Biomonika (Noolean)3.1k

please help me in running sam4weblogo

i downloaded jvarkit-master.zip and unzip how to use it

ADD REPLYlink written 5.2 years ago by Tark50

you need to compile it; Read the manual please.

ADD REPLYlink written 5.2 years ago by Pierre Lindenbaum124k

I am having problems installing berkeleydb.jar, could you please give me short advice how to install it? (I am ubuntu user)

ADD REPLYlink modified 6.5 years ago • written 6.5 years ago by Biomonika (Noolean)3.1k

you don't need bdb, if you have filled the path to the picard jars. Just type:

ant sam4weblogo

should work.

ADD REPLYlink modified 6.5 years ago • written 6.5 years ago by Pierre Lindenbaum124k
0
gravatar for Alex Reynolds
6.5 years ago by
Alex Reynolds29k
Seattle, WA USA
Alex Reynolds29k wrote:

To solve this another way, without custom parsing (scripts do all the work for you):

  1. Grab the FASTA files for your genomic build-of-interest (e.g., grab and extract all the gzipped FASTA files for hg19 here).
  2. Convert your SAM to BED
  3. Convert the resulting BED to FASTA, incorporating the whole-genome FASTA file you made from Step 1
  4. Run the FASTA file through WebLogo to generate the sequence logo
ADD COMMENTlink modified 6.5 years ago • written 6.5 years ago by Alex Reynolds29k

Thank you, interesting. Unfortunately I have no reference for my species.

ADD REPLYlink written 6.5 years ago by Biomonika (Noolean)3.1k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 2027 users visited in the last hour