Skip to content

Commit

Permalink
fix colums for webserver output
Browse files Browse the repository at this point in the history
  • Loading branch information
Patrick R. Wright committed Oct 27, 2017
1 parent 670f9db commit 175d827
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 30 deletions.
17 changes: 3 additions & 14 deletions CopraRNA2.pl
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@

# v2.1.1 : added input exceptions
# DAVID python code now py2 and py3 compatible
# changed coloring in evolutionary heatmap
# fixed issue for regions plots for sequences with non ATGC alphabet
#
# v2.1.0 : topcount default 200
# stopped tracking edits manually
Expand Down Expand Up @@ -436,19 +438,6 @@
system "convert -density '300' -resize '700' -flatten -rotate 90 sRNA_regions_with_histogram.ps sRNA_regions_with_histogram.png";
system "convert -density '300' -resize '700' -flatten -rotate 90 mRNA_regions_with_histogram.ps mRNA_regions_with_histogram.png";

# trim off last column (initial_sorting) if CopraRNA 2 prediction mode
unless ($cop1) {
system "awk -F, -vOFS=, '{NF-=1;print}' CopraRNA_result.csv > CopraRNA_result_temp.csv";
system "mv CopraRNA_result_temp.csv CopraRNA_result.csv";
system "awk -F, -vOFS=, '{NF-=1;print}' CopraRNA_result_all.csv > CopraRNA_result_all_temp.csv";
system "mv CopraRNA_result_all_temp.csv CopraRNA_result_all.csv";
# change header
system "sed -i 's/,Additional.homologs,/,Additional homologs,/g' CopraRNA_result.csv";
system "sed -i 's/,Amount.sampled/,Amount sampled/g' CopraRNA_result.csv";
system "sed -i 's/,Additional.homologs,/,Additional homologs,/g' CopraRNA_result_all.csv";
system "sed -i 's/,Amount.sampled/,Amount sampled/g' CopraRNA_result_all.csv";
}

# clean up
unless ($noclean) {

Expand All @@ -466,7 +455,7 @@
system "rm input_sRNA.fa merged_refseq_ids.txt";
system "rm CopraRNA2_prep*";
system "rm fasta_temp_file fasta_temp_file_out";
system "rm conservation_table.Rdata" unless ($cop1);
#system "rm conservation_table.Rdata" unless ($cop1);

# fix warning "rm: missing operand Try 'rm --help' for more information." ## edit 2.0.1
my $temp_fasta_check = `find -regex ".*fa[0-9]+\$"`;
Expand Down
14 changes: 14 additions & 0 deletions coprarna_aux/homology_intaRNA.pl
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,20 @@
print ERRORLOG "Error: No predictions in CopraRNA_result.csv. CopraRNA run failed.\n"; ## edit 2.0.2
}

# trim off last column (initial_sorting) if CopraRNA 2 prediction mode
unless ($cop1) {
system "awk -F, -vOFS=, '{NF-=1;print}' CopraRNA_result.csv > CopraRNA_result_temp.csv";
system "mv CopraRNA_result_temp.csv CopraRNA_result.csv";
system "awk -F, -vOFS=, '{NF-=1;print}' CopraRNA_result_all.csv > CopraRNA_result_all_temp.csv";
system "mv CopraRNA_result_all_temp.csv CopraRNA_result_all.csv";
# change header
system "sed -i 's/,Additional.homologs,/,Additional homologs,/g' CopraRNA_result.csv";
system "sed -i 's/,Amount.sampled/,Amount sampled/g' CopraRNA_result.csv";
system "sed -i 's/,Additional.homologs,/,Additional homologs,/g' CopraRNA_result_all.csv";
system "sed -i 's/,Amount.sampled/,Amount sampled/g' CopraRNA_result_all.csv";
}


if ($websrv) { # only if webserver output is requested via -websrv ## edit 2.0.5.1

my $allrefs = $refseqaffiliations{$ARGV[4]};
Expand Down
22 changes: 7 additions & 15 deletions coprarna_aux/prepare_output_for_websrv_new.pl
Original file line number Diff line number Diff line change
Expand Up @@ -63,21 +63,13 @@
my $intncRNA = $split_ooi[6] . " -- " . $split_ooi[7];
print WRITEINTERNAL $split_ooi[6] . " -- " . $split_ooi[7] . ",";

if ($cop1) {
# annotation
print WRITEINTERNAL $split[-3] . ","; ## edit 2.0.1
# additional homologs
my $temp = $split[-2]; ## edit 2.0.1
chomp $temp;
print WRITEINTERNAL $temp . ",";
} else { ## edit 2.0.6
# annotation
print WRITEINTERNAL $split[-2] . ",";
# additional homologs
my $temp = $split[-1];
chomp $temp;
print WRITEINTERNAL $temp . ",";
}
# annotation
print WRITEINTERNAL $split[-3] . ","; ## edit 2.0.1
# additional homologs
my $temp = $split[-2]; ## edit 2.0.1
chomp $temp;
print WRITEINTERNAL $temp . ",";

my $GID = "";
if ($split_ooi[8] =~ m/GeneID:(\d+)\)/) {
$GID = $1;
Expand Down
5 changes: 4 additions & 1 deletion coprarna_aux/print_archive_README.pl
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,12 @@
sequences with an annotation to visualize the interaction sites and consensus
interaction regions in Jalview.
all_predictions (not made if -cop1) :
all_predictions (not made if -cop1):
This directory contains the results for all modes available in CopraRNA 2.
conservation_table.Rdata:
Precomputed R data environment for evolutionary heatmap.
README.txt:
This file.
Expand Down

0 comments on commit 175d827

Please sign in to comment.