Commit e7ad35bc authored by Jeremy Mathews's avatar Jeremy Mathews

File Name Check

parent 3caba697
Pipeline #4137 failed with stage
in 4 seconds
This diff is collapsed.
......@@ -55,9 +55,9 @@ while (my $line = <DFILE>) {
$hash{SampleGroup} = $grp[$j];
}
$hash{SampleGroup} =~ s/_//g;
unless ($hash{FqR1} =~ m/.fastq.gz/) {
unless ($hash{FqR1} =~ m/_good.fastq.gz/) {
my $name = $hash{FqR1};
$name =~ s/.f.*/.fastq.gz/;
$name =~ s/.f.*/_good.fastq.gz/;
unless ($hash{FqR1} eq $name) {
$hash{FqR1} = $name;
unless (-e ($name)) {
......@@ -68,7 +68,7 @@ while (my $line = <DFILE>) {
$hash{FqR2} = 'na' unless ($hash{FqR2});
unless ($hash{FqR2} eq 'na') {
my $name = $hash{FqR2};
$name =~ s/.f.*/.fastq.gz/;
$name =~ s/.f.*/_good.fastq.gz/;
unless ($hash{FqR2} eq $name) {
$hash{FqR2} = $name;
unless (-e ($name)) {
......
#!/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