changeset 0:90611c479c08 draft

Uploaded
author dereeper
date Mon, 21 Jun 2021 21:10:57 +0000
parents
children 6a1c9991b723
files ragoo.pl ragoo.xml
diffstat 2 files changed, 89 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ragoo.pl	Mon Jun 21 21:10:57 2021 +0000
@@ -0,0 +1,58 @@
+#!/usr/bin/perl
+
+use strict;
+
+my $scaffolds= $ARGV[0];
+my $reference = $ARGV[1];
+my $output = $ARGV[2];
+my $output2 = $ARGV[3];
+
+my $tmpdir = "tmpdir$$";
+
+mkdir($tmpdir);
+
+
+my ($sc) = split(",",$scaffolds);
+$scaffolds = $sc;
+
+system("cp -rf $scaffolds $tmpdir/scaffolds.fa");
+system("cp -rf $reference $tmpdir/reference.fa");
+chdir($tmpdir);
+system("ragoo.py scaffolds.fa reference.fa");
+
+
+my %hash;
+my $id;
+open(F,"ragoo_output/ragoo.fasta");
+while(<F>){
+	if (/>(.*)/){$id = $1;}
+	else{
+		$hash{$id}.= $_;
+	}
+}
+close(F);
+
+open(O,">$output");
+foreach my $id(keys(%hash)){
+	print O ">$id\n";
+	my $seq = $hash{$id};
+	for (my $i =0; $i <= length($seq); $i =$i+80){
+		my $subseq = substr($seq,$i,80);
+		print O "$subseq\n";
+	}
+}
+close(O);
+
+open(O,">$output2");
+foreach my $id(keys(%hash)){
+        if ($id =~/Chr0_RaGOO/){
+                next;
+        }
+        print O ">$id\n";
+        my $seq = $hash{$id};
+        for (my $i =0; $i <= length($seq); $i =$i+80){
+                my $subseq = substr($seq,$i,80);
+                print O "$subseq\n";
+        }
+}
+close(O);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ragoo.xml	Mon Jun 21 21:10:57 2021 +0000
@@ -0,0 +1,31 @@
+<tool id="ragoo" name="RaGOO" version="1.0">
+  <description>Order and assign scaffolds</description>
+ <requirements>
+  <requirement type="package" version="1.1">ragoo</requirement>
+ </requirements>
+
+  <command>perl ${__tool_directory__}/ragoo.pl $input $reference $output $output2
+</command>
+
+ 
+  <inputs>
+  <param format="fasta" name="input" type="data" label="Fasta file with contigs to be ordered and oriented: "/>
+  <param format="fasta" name="reference" type="data" label="Reference fasta file"/>
+   
+ </inputs>
+
+ <outputs>
+	 <data format="fasta" name="output" label="Fasta output of assigned scaffolds"/>
+	 <data format="fasta" name="output2" label="Fasta output of assigned scaffolds (without Chr0)"/>
+</outputs>
+
+  <help>
+ For full documentation, please go to the RaGOO website : https://github.com/malonge/RaGOO 
+	  
+</help>
+
+  <citations>
+	  <citation type="doi"> 10.1186/s13059-019-1829-6 </citation>
+
+  </citations>
+</tool>