Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions hisat2/2.0.5/Hisat2_align.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Getopt::Long qw(:config no_ignore_case no_auto_abbrev pass_through);

my (@file_query, $database_path, $user_database_path, $annotation_path,
$user_annotation_path, $file_names, $root_names, @file_query2, $lib_type, $file_type, $n_cores);
$user_annotation_path, $file_names, $root_names, @file_query2, $file_type, $n_cores);


GetOptions( "file_query=s" => \@file_query,
Expand All @@ -16,7 +16,6 @@
"user_annotation=s" => \$user_annotation_path,
"file_names=s" => \$file_names,
"root_names=s" => \$root_names,
"lib_type=s" => \$lib_type,
"file_type=s" => \$file_type,
"n_cores=s" => \$n_cores,
);
Expand Down Expand Up @@ -71,13 +70,12 @@

my $app = "/usr/bin/hisat2";
my $format = $file_type;
my $library = $lib_type;

chomp(my $basename = `basename $query_file`);
$basename =~ s/\.\S+$//;

if ($format eq "PE") {
my $align_command = "$app $HISAT_ARGS --rna-strandness $library -x $name -1 $query_file -2 $second_file -p $n_cores | samtools view -bS - > $query_file.bam";
my $align_command = "$app $HISAT_ARGS -x $name -1 $query_file -2 $second_file -p $n_cores | samtools view -bS - > $query_file.bam";
report("Executing: $align_command\n");
system $align_command;
system "samtools sort $query_file.bam $basename.sorted";
Expand All @@ -86,7 +84,7 @@
system "rm -rf *bam";
}
elsif($format eq "SE"){
my $align_command = "$app $HISAT_ARGS --rna-strandness $library -x $name -U $query_file -p $n_cores | samtools view -bS - > $query_file.bam";
my $align_command = "$app $HISAT_ARGS -x $name -U $query_file -p $n_cores | samtools view -bS - > $query_file.bam";
report("Executing: $align_command\n");
system $align_command;
system "samtools sort $query_file.bam $basename.sorted";
Expand All @@ -101,4 +99,4 @@

sub report {
print STDERR "$_[0]\n";
}
}