Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
wujingcheng committed Nov 12, 2018
1 parent 4940295 commit 4c43408
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions sub/expression_filter.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/usr/bin/perl-w
# ******************** Software Information *******************
# Version: TSNAD v1.1
# File: expression_filter.pl
# Perl Version: 5.18.2
# Finish time: Octobor, 2018.
# Developer: Jingcheng Wu, Zhan Zhou, Wenyi Zhao
# Copyright (C) 2018-2019 - College of Pharmaceutical Sciences,
# Zhejiang University - All Rights Reserved
# *************************************************************
use strict;

my $in=$ARGV[0]; #input mutation file
my $seq=$ARGV[1]; #gene expression file
my $out=$ARGV[2]; # output mutation with expression

open IN, "<$in" or die "cannot open $in:$!";
open SEQ, "<$seq" or die "cannot open $seq:$!";
open OUT, ">$out" or die "cannot open $out:$!";

my %exp;
while (<SEQ>){
chomp;
my @line=split/\t/,$_;
$exp{$line[0]."\t".$line[1]}=$line[7]."\t".$line[8];
}

while (<IN>){
chomp;
my @line=split/\t/,$_;
if ($_=~/##/){
print OUT"$_\n";
}
elsif($_=~/#/){
print OUT "$_\tRPKM\tTPM\n";
}
elsif($exp{$line[3]."\t".$line[17]}){
my $expression=$exp{$line[3]."\t".$line[17]};
my @expession=split/\t/,$expression;
print OUT"$_\t$expression\n" if ($expression>1);
}
}

0 comments on commit 4c43408

Please sign in to comment.