Skip to content

Commit 3a5c199

Browse files
Added regex for the InputDataPattern
1. Added regex for the InputDataPattern Params 2. InputDataLocation and OutputDataLocation help text is changed
1 parent 3faee64 commit 3a5c199

1 file changed

Lines changed: 34 additions & 12 deletions

File tree

cft-templates/nextflow-advanced.yaml

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ Parameters:
5757
Description: Public Docker container image of the pipeline to be executed. If you are using a custom pipeline, ensure that the custom container image is publicly available on Docker Hub
5858
InputDataLocation:
5959
Description: >-
60-
An S3 bucket which holds input data for the Nextflow pipeline. The bucket name must respect the S3 bucket naming conventions
61-
(can contain lowercase letters, numbers, periods and hyphens).
60+
The path to the location which holds the Input data files. This can point to a local path on the head node or to an S3 bucket. Eg /home/ec2-user/studies/ProjectStorage/Shared or mys3bucket.
61+
Type in the search box to find s3 buckets created through Research Gateway.
6262
Type: String
6363
InputDataPattern:
6464
Description: >-
@@ -67,9 +67,9 @@ Parameters:
6767
Default: samplesheet.csv
6868
OutputDataLocation:
6969
Description: >-
70-
The full path on the local disk where outputs of the pipeline should be stored. The default path above will enable you to view the outputs via the browser. The path should be accessible to the user ec2-user.
71-
Alternately, provide an S3 bucket for storing analysis results. The bucket name must respect the S3 bucket naming conventions
72-
(can contain lowercase letters, numbers, periods and hyphens).
70+
The path to the location which holds the Output data files. This can point to a local path on the head node or to an S3 bucket.
71+
A local path should be accessible to the user ec2-user. Alternately, provide an S3 bucket for storing analysis results.
72+
Type in the search box to find s3 buckets created through Research Gateway.
7373
Default: /home/ec2-user/nextflow/outputs/
7474
Type: String
7575
ComputeEnvMinvCpus:
@@ -91,7 +91,7 @@ Parameters:
9191
AllowedValues: [t2.nano, t2.micro, t2.small, t2.medium]
9292
ConstraintDescription: Must be a valid EC2 instance type.
9393
KeyPair:
94-
Description: Name of an existing EC2 KeyPair to enable SSH access to the Head Node. Please create a key pair from the key pair screen if they are not available in the dropdown.
94+
Description: Name of an existing EC2 KeyPair to enable SSH access to the Head Node. If no key pairs exist, please create one from the button next to the dropdown. Please contact your Administrator if you are unable to create one.
9595
Type: AWS::EC2::KeyPair::KeyName
9696
ConstraintDescription: Must be the name of an existing EC2 KeyPair.
9797
AllowedSSHLocation:
@@ -542,17 +542,20 @@ Resources:
542542
UserData:
543543
Fn::Base64: !Sub |
544544
#!/bin/bash -xe
545-
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1
546545

547546
sudo yum update -y --security
548-
cd /root/
547+
cd /root/
549548

549+
pattern=${InputDataPattern}
550+
pattern=$(echo $pattern | sed -e 's#^/*##')
551+
echo $pattern
552+
550553
getOutputData=${OutputDataLocation}
551554
getFirstChar=`echo $getOutputData | cut -c1-1`
552555

553556
if [ "$getFirstChar" == "/" ]
554557
then :
555-
echo "Ngnix URL"
558+
echo "Ngnix URL"
556559
OutputDataLocation=${OutputDataLocation}
557560
echo $OutputDataLocation
558561
else
@@ -561,18 +564,34 @@ Resources:
561564
echo $OutputDataLocation
562565
fi
563566

567+
568+
getInputData=${InputDataLocation}
569+
getIFirstChar=`echo $getInputData | cut -c1-1`
570+
571+
if [ "$getIFirstChar" == "/" ]
572+
then :
573+
echo "Ngnix URL"
574+
InputDataLocation=${InputDataLocation}
575+
echo $InputDataLocation
576+
else
577+
echo "S3 Path"
578+
InputDataLocation="s3://"${InputDataLocation}
579+
echo $InputDataLocation
580+
fi
581+
564582
cd .nextflow/
565583
PROJECT_NF_CONFIG=config
566584

567-
cat << EOF >> $PROJECT_NF_CONFIG
585+
cat << EOF >> $PROJECT_NF_CONFIG
586+
568587
process.container = '${PipelineContainer}'
569588
plugins {
570589
id 'nf-amazon'
571590
}
572591
docker.enabled = true
573592
params.outdir='$OutputDataLocation'
574-
params.reads='s3://${InputDataLocation}/${InputDataPattern}'
575-
params.input='s3://${InputDataLocation}/${InputDataPattern}'
593+
params.reads='$InputDataLocation/$pattern'
594+
params.input='$InputDataLocation/$pattern'
576595
profiles {
577596
standard {
578597
process.container = '${PipelineContainer}'
@@ -587,6 +606,7 @@ Resources:
587606
aws.batch.cliPath = '/home/ec2-user/miniconda/bin/aws'
588607
}
589608
}
609+
590610
EOF
591611

592612
cd /home/ec2-user/
@@ -598,7 +618,9 @@ Resources:
598618
NEXTFLOW_CONFIG=nextflow.config
599619

600620
cat << EOF >> $NEXTFLOW_CONFIG
621+
601622
params.outdir='$OutputDataLocation'
623+
602624
EOF
603625

604626
docker pull ${PipelineContainer}

0 commit comments

Comments
 (0)