Commit 7c2ae90f authored by Brandi Cantarel's avatar Brandi Cantarel

Merge branch '15-CheckInputFiles' into 'master'

Resolve "Check file inputs"

Closes #15 and #16

See merge request !7
parents cc35440c 888e1ee4
Pipeline #4285 passed with stage
in 156 minutes and 55 seconds
......@@ -19,6 +19,6 @@ test_human:
test_mouse:
stage: integration
script:
- nextflow run -with-dag flowchart.png -with-timeline mouse_timeline.html -with-report mouse_report.html workflow/main.nf --input /project/shared/bicf_workflow_ref/workflow_testdata/rnaseq --design /project/shared/bicf_workflow_ref/workflow_testdata/rnaseq/mouse_se.design.txt --pairs se --fusion skip --genome /project/shared/bicf_workflow_ref/GRCm38 --markdups null --output mouse_output
- nextflow run -with-dag flowchart.png -with-timeline mouse_timeline.html -with-report mouse_report.html workflow/main.nf --input /project/shared/bicf_workflow_ref/workflow_testdata/rnaseq --design /project/shared/bicf_workflow_ref/workflow_testdata/rnaseq/mouse_se.design.txt --pairs se --fusion skip --genome /project/shared/bicf_workflow_ref/mouse/GRCm38 --markdups null --output mouse_output
artifacts:
expire_in: 2 days
This diff is collapsed.
#!/usr/bin/perl -w
#check_designfile.pl
use strict;
use warnings;
my $pe = shift @ARGV;
my $dfile = shift @ARGV;
open OUT, ">design.valid.txt" or die $!;
......@@ -11,7 +14,6 @@ $head =~ s/FullPathTo//g;
my @colnames = split(/\t/,$head);
my %newcols = map {$_=> 1} @colnames;
unless (grep(/FqR1/,@colnames)) {
die "Missing Sequence Files in Design File: FqR1\n";
}
......@@ -49,16 +51,32 @@ while (my $line = <DFILE>) {
$hash{FinalBam} = $hash{SampleID}.".final.bam";
$hash{Bam} = $hash{SampleID}.".bam";
unless ($hash{SampleGroup}) {
$j = $lnct %% 2;
my $j = $lnct %% 2;
$hash{SampleGroup} = $grp[$j];
}
$lnct ++;
$hash{SampleGroup} =~ s/_//g;
unless ($hash{FqR1} =~ m/_good.fastq.gz/) {
my $name = $hash{FqR1};
$name =~ s/.f.*/_good.fastq.gz/;
unless ($hash{FqR1} eq $name) {
$hash{FqR1} = $name;
next unless (-e ($name));
}
}
$hash{FqR2} = 'na' unless ($hash{FqR2});
unless ($hash{FqR2} eq 'na') {
my $name = $hash{FqR2};
$name =~ s/.f.*/_good.fastq.gz/;
unless ($hash{FqR2} eq $name) {
$hash{FqR2} = $name;
next unless (-e ($name));
}
}
my @line;
foreach $f (@cols) {
foreach my $f (@cols) {
push @line, $hash{$f};
}
print OUT join("\t",@line),"\n";
$hash{FqR2} = 'na' unless ($hash{FqR2});
print join(",",$hash{SampleID},$hash{FqR1},$hash{FqR2}),"\n";
$lnct ++;
}
#!/bin/bash
#check_inputfiles.sh
fqs=`ls *.f*`
for i in $fqs;
do
if [[ ${i} == *.fq ]];
then
new_name=`echo ${i} | sed -e "s/.fq\$/_good.fastq/"`;
mv ${i} ${new_name};
`pigz -f ${new_name}`;
elif [[ ${i} == *.fastq ]];
then
new_name=`echo ${i} | sed -e "s/.fastq\$/_good.fastq/"`;
mv ${i} ${new_name};
`pigz -f ${new_name}`;
elif [[ ${i} == *.fq.gz ]];
then
new_name=`echo ${i} | sed -e "s/.fq.gz\$/_good.fastq.gz/"`;
mv ${i} ${new_name};
else
new_name=`echo ${i} | sed -e "s/.fastq.gz\$/_good.fastq.gz/"`;
mv ${i} ${new_name};
fi;
done
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment