Skip to content

Commit

Permalink
adding first version of code
Browse files Browse the repository at this point in the history
  • Loading branch information
cblatti3 committed Mar 23, 2017
1 parent dcded46 commit acbdd22
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 0 deletions.
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
############################################################
# Dockerfile to build a container that pulls KN subnetworks
############################################################

# Set the base image to python v3
FROM python:3.4-slim

# File Author / Maintainer
MAINTAINER Charles Blatti <[email protected]>

# Update the repository sources list
RUN apt-get update && apt-get install -y \
curl \
time \
rsync \
wget \
s3cmd \
python3-pip

RUN pip3 install awscli
RUN wget -O /home/credentials http://knowcloud.cse.illinois.edu/index.php/s/E3OL5QpTj8SrOix/download
COPY kn_fetcher.sh /home/
RUN chmod 775 /home/kn_fetcher.sh


# Set default contain command on run
CMD /bin/bash

# Set container execution behavior
# ENTRYPOINT
61 changes: 61 additions & 0 deletions kn_fetcher.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
class: CommandLineTool
cwlVersion: v1.0
id: "kn_fetcher"
label: "Knowledge Network Fetcher"
doc: "Retrieve appropriate subnetwork from KnowEnG Knowledge Network from AWS S3 storage"

#dct:creator:
# "@id": "http://orcid.org/0000-0002-4683-6271"
# foaf:name: Charles Blatti
# foaf:mbox: "mailto:[email protected]"

requirements:
- class: DockerRequirement
dockerPull: "quay.io/cblatti3/kn_fetcher:0.1"
- class: InlineJavascriptRequirement

hints:
- class: ResourceRequirement
coresMin: 1
ramMin: 1024 #"the process requires at least 1G of RAM
outdirMin: 512000

inputs:
- id: bucket
label: "AWS S3 Bucket Name"
doc: "the aws s3 bucket"
type: string
default: "KnowNets/KN-6rep-1611/userKN-6rep-1611"
inputBinding:
position: 1
- id: network_type
label: "Subnetwork Class"
doc: "the type of subnetwork"
type: string
default: Gene
inputBinding:
position: 2
- id: taxon
label: "Subnetwork Species ID"
doc: "the taxonomic id for the species of interest"
type: string
default: "9606"
inputBinding:
position: 3
- id: edge_type
label: "Subnetwork Edge Type"
doc: "the edge type keyword for the subnetwork of interest"
type: string
default: PPI_physical_association
inputBinding:
position: 4

baseCommand: /home/kn_fetcher.sh

outputs:
- id: output_file
label: "Subnetwork Edge File"
doc: "4 column format for subnetwork for single edge type and species"
outputBinding:
glob: "*.edge"
type: File
3 changes: 3 additions & 0 deletions kn_fetcher.job
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
network_type: "Gene"
taxon: "9606"
edge_type: "STRING_textmining"
9 changes: 9 additions & 0 deletions kn_fetcher.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

BUCKET=$1
NETWORKTYPE=$2
TAXON=$3
EDGETYPE=$4
MYCMD="mkdir -p ~/.aws/ && cp /home/credentials ~/.aws/ && aws s3 cp s3://$BUCKET/$NETWORKTYPE/$TAXON/$EDGETYPE/ ./ --recursive"
echo $MYCMD
eval $MYCMD

0 comments on commit acbdd22

Please sign in to comment.