![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Generate consensus sequence with Samtools mpileup? | Heisman | Bioinformatics | 4 | 10-28-2013 05:57 PM |
Blast 2 multifasta files one against the other | Kawaccino | Bioinformatics | 5 | 06-06-2013 11:56 PM |
Generate consensus sequence with samtools mpileup | Lilith-Elina | Bioinformatics | 0 | 04-08-2013 02:38 AM |
Generate consensus sequence from BAM alignment | Adam Witney | General | 2 | 09-14-2011 03:49 AM |
Help needed to generate Consensus from alignment | sarbashis | Illumina/Solexa | 0 | 08-10-2011 10:58 PM |
![]() |
|
Thread Tools |
![]() |
#1 |
Member
Location: Canada, Quebec Join Date: Apr 2012
Posts: 53
|
![]()
Hi,
I have a multifasta like: >sequence1 ATCGATCATCG >sequence2 ATCGATNNTCG >sequence3 ATCGATCATCG All sequences are the same, except there are some N. I want to make a consensus with the N if there are. Do you know I can do this? Thanks! |
![]() |
![]() |
![]() |
#2 |
Member
Location: Canada, Quebec Join Date: Apr 2012
Posts: 53
|
![]()
A little up!
Please ![]() |
![]() |
![]() |
![]() |
#3 |
David Eccles (gringer)
Location: Wellington, New Zealand Join Date: May 2011
Posts: 838
|
![]()
here's my rough 5-minute attempt:
Code:
#!/usr/bin/perl use warnings; use strict; my @sequence = (); while(<>){ if(!/^>/){ chomp; my @bases = split(//,$_); for(my $i = 0; $i < @bases; $i++){ if($bases[$i] eq "N"){ $sequence[$i] = "N"; } elsif($sequence[$i] ne "N") { $sequence[$i] = $bases[$i]; } } } } print(">consensus\n".join("",@sequence)."\n"); |
![]() |
![]() |
![]() |
Thread Tools | |
|
|