Skip to content

Commit

Permalink
WIP Supernova cloud pipeline scripts to convert
Browse files Browse the repository at this point in the history
  • Loading branch information
ebelter committed Jun 24, 2018
1 parent 4d65a41 commit 1548ab2
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 0 deletions.
24 changes: 24 additions & 0 deletions bin/run-mkoutput
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

set -e

assembly_id="${1}"
if [ -z "${assembly_id}" ]; then
echo "USAGE: $0 ASSEMBLY_ID"
exit 1
fi

assembly_dir="/mnt/disks/linked-reads-pilot/assembly/${assembly_id}";
if [ ! -d "${assembly_dir}" ]; then
echo "No assembly directory! ${assembly_dir}"
exit 1
fi

mkoutput_dir="${assembly_dir}/mkoutput";
mkdir -p "${mkoutput_dir}"
cd "${mkoutput_dir}"

source /opt/supernova-2.0.0/sourceme.bash
for style in raw megabubbles pseudohap2; do
exec "supernova mkoutput --asmdir=$assembly_dir/outs/assembly --outprefix=${assembly_id}.${style} --style=${style}"
done
48 changes: 48 additions & 0 deletions bin/run-supernova
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/bash

set -e

sample="${1}"
if [ -z "${sample}" ]; then
echo "No sample given!"
exit 1
fi

echo "GCloud Auth"
gcloud auth activate-service-account --key-file /etc/gcp-auth/WashU-Genome-Inh-Dis-Analysis.service-account-key.json

data_base_path="/mnt/disks/data"
fastq_path="${data_base_path}/reads/${sample}"
mkdir -p "${fastq_path}"
assembly_base_path="${data_base_path}/assembly"
mkdir -p "${assembly_base_path}"

echo "Sample: ${sample}"
echo "Rsyncing fastqs from the object store..."
cd "${fastq_path}"
gsutil ls gs://mgi-rg-linked-reads-ccdg-pilot/reads/H53J3DSXX/${sample}/
gsutil -m rsync -r gs://mgi-rg-linked-reads-ccdg-pilot/reads/H53J3DSXX/${sample}/ .
echo "Rsyncing fastqs from the object store...OK"

echo "Running supernova..."
cd "${assbemly_base_path}"
source /opt/supernova-2.0.1/sourceme.bash
supernova run --id="${sample}" --fastqs="${fastq_path}" --uiport=63108 --nodebugmem --localcores=50 --localmem=320
echo "Running supernova...OK"

echo "Running mkoutput..."
assembly_path="${assembly_base_path}/${sample}"
mkoutput_path="${assembly_path}/mkoutput";
mkdir -p "${mkoutput_path}"
cd "${mkoutput_dir}"
for style in raw megabubbles pseudohap2; do
exec supernova mkoutput --asmdir="${assembly_path}/outs/assembly" --outprefix="${sample}.${style}" --style="${style}"
done
echo "Running mkoutput...OK"

echo "Rsyncing assembly to object store..."
cd "${assembly_base_path}"
echo gsutil -m rsync -r "${sample}" "gs://mgi-rg-linked-reads-ccdg-pilot/assembly/${sample}"
echo "Rsyncing assembly to object store...OK"

echo "Done!"
39 changes: 39 additions & 0 deletions lib/Tenx/Assembly/Command/Mkoutput.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package Tenx::Assembly::Command::Mkoutput;

use strict;
use warnings 'FATAL';

class Tenx::Assembly::Command::Mkoutput {
is => 'Command::V2',
has_input => {
assembly => {
is => 'Tenx::Assembly',
doc => 'The assembly to run mkoutput on.',
},
styles => {
is => 'Text',
is_many => 1,
valid_values => [qw/ raw megabubbles pseudohap2 /],
default_value => 'raw,megabubbles,pseudohap2',
doc => 'The style of mkutput to run.',
},
},
};

sub shortcut {
die "shortcut is not implemented"
}

sub execute {
my ($self) = @_;

#mkdir $self->assembly->mkoutput_path;

for my $style ( $self->styles ) {
$self->status_message("Style: $style");
}

1;
}

1;

0 comments on commit 1548ab2

Please sign in to comment.