SEQanswers

Go Back   SEQanswers > Bioinformatics > Bioinformatics



Similar Threads
Thread Thread Starter Forum Replies Last Post
difference blasr output in two fasta file lingling huang Pacific Biosciences 0 12-20-2016 01:14 AM
Convert Cytogenetic location to base pair position LouiseT Bioinformatics 0 03-04-2013 07:18 PM
Difference between unaligned and aligned FASTA file brucezepplin Bioinformatics 1 12-23-2012 04:49 AM
Perl: get specific base from FASTA file. njh_TO Bioinformatics 6 02-02-2012 06:34 AM
How to find out the base on a certain position shuang Bioinformatics 8 09-09-2011 06:45 AM

Reply
 
Thread Tools
Old 02-09-2017, 09:32 AM   #1
rajeshkmaurya08
Member
 
Location: india

Join Date: Feb 2017
Posts: 14
Default To find the difference in base pair position of two fasta file

Hello,
I am just beginner in Perl,
I have Two fasta file of different length.
I would like to align them to find difference in nucleotide position.

Output should be like this
Total length of fasta files
First reference file: 1253630 base pair
Second file: 4523366 base pair
If match 2nd file is same as 1st reference file.
Match position at base pair
a-t 455222
c-g 455665
if not match out put should like this
Mismatch position at base pair
A-C 100025
C-T 600045
Result: should be in Output.txt

I tried this code given below:

use strict;
use warnings;
my $file1 = 'chr20.txt';
my $file2 = 'chr21.txt';
my $error = 'error.txt';
open(my $in1, '<', $file1) or die "Cannot open file '$file1' for readi
+ng: $!";
open(my $in2, '<', $file2) or die "Cannot open file '$file2' for readi
+ng: $!";
open(my $out, '>', $error) or die "Cannot open file '$error' for writi
+ng: $!";
my $lineno = 1;
while (my $line1 = <$in1>)
{
my $line2 = <$in2>;
print "$. : $line2,$line1,";
printf $out "Error:lineno:%d mismatch found \n", $lineno
unless $line1 eq $line2;

++$lineno;
}
close $out or die "Cannot close file '$error': $!";
close $in2 or die "Cannot close file '$file2': $!";
close $in1 or die "Cannot close file '$file1': $!";
rajeshkmaurya08 is offline   Reply With Quote
Old 02-09-2017, 09:33 PM   #2
rajeshkmaurya08
Member
 
Location: india

Join Date: Feb 2017
Posts: 14
Default

can anybody help me to short out the problem?
rajeshkmaurya08 is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off




All times are GMT -8. The time now is 02:33 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Single Sign On provided by vBSSO