diff miRPlant.pl @ 46:ca05d68aca13 draft

Uploaded
author big-tiandm
date Thu, 13 Nov 2014 22:43:35 -0500
parents 0c4e11018934
children
line wrap: on
line diff
--- a/miRPlant.pl	Thu Oct 30 21:29:35 2014 -0400
+++ b/miRPlant.pl	Thu Nov 13 22:43:35 2014 -0500
@@ -10,11 +10,11 @@
 use strict;
 use Getopt::Long;
 use threads;
-use threads::shared;
+#use threads::shared;
 use File::Path;
 use File::Basename;
-use RNA;
-use Term::ANSIColor;
+#use RNA;
+#use Term::ANSIColor;
 
 my %opts;
 GetOptions(\%opts,"i:s@","tag:s@","format=s","gfa=s","pre=s","mat=s","rfam:s","dis:i","flank:i","mfe:f","idx:s","idx2:s","mis:i","r:i","v:i","e:i","f:i","a:s","M:i","t:i","min:i","max:i","o:s","path:s","D","h");
@@ -28,7 +28,7 @@
 
 my $format=$opts{'format'};
 if ($format ne "fastq" && $format ne "fq" && $format ne "fasta" && $format ne "fa") { 
-	&printErr();
+	#&printErr();
 	die "Parameter \"-format\" is error! Parameter is fastq, fq, fasta or fa\n";
 }
 
@@ -274,7 +274,7 @@
 sub quantify{
 	my $tag=join "\\;" ,@mark;
 	system("perl $scipt_path/quantify.pl -p $opts{pre} -m $opts{mat} -r $data -o $dir -time $time -mis $mis -t $t -e $upstream -f $downstream -tag $tag");
-#	print "\nquantify.pl -p $opts{pre} -m $opts{mat} -r $data -o $dir -time $time -mis $mis -t $t -e $upstream -f $downstream -tag $tag\n";
+	print "\nquantify.pl -p $opts{pre} -m $opts{mat} -r $data -o $dir -time $time -mis $mis -t $t -e $upstream -f $downstream -tag $tag\n";
 }
 sub filterbylength{
 	my $tmpmark=join ",", @mark;
@@ -321,14 +321,14 @@
 	}
 	close CON;
 	if (@filein != @mark) {
-		&printErr();
+		#&printErr();
 		die "Maybe config file have some wrong!!!\n";
 	}
 }
 sub check_rawdata{
 	my ($fileforcheck)=@_;
 	if (!(-s $fileforcheck)) {
-		&printErr();
+		#&printErr();
 		die "Can not find $fileforcheck, or file is empty!!!\n";
 	}
 	if ($format eq "fasta" || $format eq "fa") {
@@ -344,12 +344,12 @@
 	my $line=<N>;
 	chomp $line;
     if($line !~ /^>\S+/){
-        printErr();
+        #printErr();
         die "The first line of file $file_reads does not start with '>identifier'
 Reads file $file_reads is not a valid fasta file\n\n";
     }
     if(<N> !~ /^[ACGTNacgtn]*$/){
-        printErr();
+        #printErr();
         die "File $file_reads contains not allowed characters in sequences
 Allowed characters are ACGTN
 Reads file $file_reads is not a fasta file\n\n";
@@ -370,21 +370,21 @@
 		chomp $c;
 		chomp $d;
 		if($a!~/^\@/){
-			&printErr();
+			#&printErr();
 			die "$file_reads is not a fastq file\n\n";
 		}
 		if($b!~ /^[ACGTNacgtn]*$/){
-			&printErr();
+			#&printErr();
 			die "File $file_reads contains not allowed characters in sequences
 Allowed characters are ACGTN
 Reads file $file_reads is not a fasta file\n\n";
 		}
 		if ($c!~/^\@/ && $c!~/^\+/) {
-			&printErr();
+			#&printErr();
 			die "$file_reads is not a fastq file\n\n";
 		}
 		if ((length $b) != (length $d)) {
-			&printErr();
+			#&printErr();
 			die "$file_reads is not a fastq file\n\n";
 		}
 		my @qv=split //,$d;
@@ -407,19 +407,20 @@
 	}
 	closedir I;
 	if (@ret != 1) {
-		&printErr();
+		#&printErr();
 
 		die "Can not find directory or file which name has string: $str !!!\n";
 	}
 	return $ret[0];
 }
 
+=cut
+
 sub printErr{
     print STDERR color 'bold red';
     print STDERR "Error: ";
     print STDERR color 'reset';
 }
-=cut
 sub Time{
         my $time=time();
         my ($sec,$min,$hour,$day,$month,$year) = (localtime($time))[0,1,2,3,4,5,6];
@@ -453,15 +454,16 @@
 print <<"USAGE";
 Version $version
 Usage:
+
 $0 -i -format -gfa -index -pre -mat -rfam -D -a -M -min -max -mis -e -f -v -t  -o  -path
 options:
--i string,  input file#input files information file
-		/path/filename	mark
-		/path/filename	mark
-		...
+-i input files, # raw data file, can be multipe eg. -i xxx.fq -i xxx .fq ...
+-tag string # raw data file names, -tag xxx -tag xxx
 
 -format string,#specific input rawdata file format : fastq|fq|fasta|fa
 
+-path scirpt path
+
 -gfa string,  input file # genome fasta. sequence file
 -idx string, genome file index, file-prefix #(must be indexed by bowtie-build) The parameter
                 string must be the prefix of the bowtie index. For instance, if