Skip to content

Commit

Permalink
Mark mismatch in output: #2
Browse files Browse the repository at this point in the history
  • Loading branch information
wangqinhu committed Jul 12, 2017
1 parent d444337 commit f24e663
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
6 changes: 3 additions & 3 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ ABOUT
target sites of CRISPR/CAS9 system by using seqmap

VERSION
Version: 1.4
Oct 31, 2016
Version: 1.5
Jul 12, 2017

SYNOPSIS
$ perl ./offscan.pl <option>
Expand Down Expand Up @@ -43,7 +43,7 @@ LICENSE



cas9off version 1.4
cas9off version 1.5
===================

Usage:
Expand Down
29 changes: 22 additions & 7 deletions offscan.pl
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ =head1 ABOUT
=head1 VERSION
Version: 1.4
Oct 31, 2016
Version: 1.5
Jul 12, 2017
=head1 SYNOPSIS
Expand Down Expand Up @@ -215,12 +215,12 @@ =head1 LICENSE
next unless $maln =~ /GG$/i;
$map[$i++] = { "refid" => $refid,
"refcor" => $refcor,
"refaln" => $maln,
"refaln" => uc($maln),
"rnaid" => $rnaid,
"rnaseq" => $rnaseq . "NGG",
"rnaseq" => uc($rnaseq . "NGG"),
"numis" => $numis,
"str" => $str,
"flk" => $flk
"flk" => uc($flk)
};
push @tab, $rnaid;
}
Expand All @@ -233,8 +233,9 @@ =head1 LICENSE
open (OUT, ">$rpt") or die "Cannot open file $rpt: $!\n";
print OUT "Target ID\tTarget Site\tReference ID\tReference Alignment\tNo. of Mismatch\tStrand\tMatch Start\tFlanking Sequence\n";
foreach my $map (@map) {
my $diff_aln = mark_diff_aln($map->{"refaln"}, $map->{"rnaseq"});
print OUT $map->{"rnaid"}, "\t", $map->{"rnaseq"}, "\t", $map->{"refid"}, "\t",
$map->{"refaln"}, "\t", $map->{"numis"}, "\t", $map->{"str"}, "\t",
$diff_aln, "\t", $map->{"numis"}, "\t", $map->{"str"}, "\t",
$map->{"refcor"}, "\t", $map->{"flk"}, "\n";
}
close OUT;
Expand Down Expand Up @@ -364,11 +365,25 @@ sub sgRNA2fasta {
return $out_file;
}

sub mark_diff_aln {
my ($aln, $rna) = @_;
my $len = $rsz - 3;
my @aln = split //, $aln;
my @rna = split //, $rna;
for (my $i = 0; $i < $len; $i++) {
if ($aln[$i] ne $rna[$i]) {
$aln[$i] = lc($aln[$i]);
}
}
my $diff_aln = join('', @aln);
return $diff_aln;
}

sub usage
{
print <<USAGE;
cas9off version 1.4
cas9off version 1.5
Usage:
Expand Down

0 comments on commit f24e663

Please sign in to comment.