+ date=2019-10-01 + data_source=data_sources + organism='Homo sapiens' ++ dirname ../prep/study_metadata_layout.sh + sdir=../prep + study=ERP003495 + org=human + dsource=sra + preds_file=../prep/Human.SRA_curated_predict.meta.w_rids.rtypes.tsv + perl -e '$study="ERP003495"; $study=~/(..)$/; $lo=$1; `mkdir -p $lo/$study`; print "$lo/$study\n";' ++ cat ERP003495.dir + dir=95/ERP003495 + cat ../prep/samples.tsv.header /dev/fd/63 ++ fgrep ' ERP003495 ' ../prep/samples.tsv + cut_cols=1-3 + [[ human == \m\o\u\s\e ]] + [[ human == \h\u\m\a\n ]] + gzip + cut -f 1-41 95/ERP003495/samples.tsv.ERP003495 cut: 95/ERP003495/samples.tsv.ERP003495: No such file or directory + gzip + cut -f 1-3,42-150 95/ERP003495/samples.tsv.ERP003495 cut: 95/ERP003495/samples.tsv.ERP003495: No such file or directory + [[ human == \g\t\e\x ]] + [[ human == \t\c\g\a ]] + proj_header='rail_id external_id study project organism file_source metadata_source date_processed' + dsource_path=data_sources/sra + extra_proj_cols='Homo sapiens data_sources/sra data_sources/sra 2019-10-01' + gzip + cat /dev/fd/63 /dev/fd/62 ++ echo 'rail_id external_id study project organism file_source metadata_source date_processed' ++ tail -n+2 95/ERP003495/samples.tsv.ERP003495 ++ cut -f 1-3 ++ perl -ne 'chomp; $f=$_; ($rid,$run,$study)=split(/\t/,$f); print "$f\t$study\tHomo sapiens data_sources/sra data_sources/sra 2019-10-01\n";' tail: cannot open ‘95/ERP003495/samples.tsv.ERP003495’ for reading: No such file or directory + [[ -n ../prep/Human.SRA_curated_predict.meta.w_rids.rtypes.tsv ]] + gzip + cat /dev/fd/63 /dev/fd/62 ++ head -1 ../++ perl -e '$s="ERP003495"; $s=~/(..)$/; $lo=$1; print "$lo\n";' + lo=95 + gzip + cat /dev/fd/63 /dev/fd/62 ++ head -1 ../prep/seqtk.w++ perl -e '$s="ERP003495"; $s=~/(..)$/; $lo=$1; print "$lo\n";' + l+ rm 95/ERP003495/samples.tsv.ERP003495 rm: cannot remove ‘95/ERP003495/samples.tsv.ERP003495’: No such file or directory + rm ERP+ rm 95/ERP003495/samples.tsv.ERP003495 rm: cannot remove ‘95/ERP003495/samples.tsv.ERP003495’: No such file or directory + rm ERP003495.dir rm: cannot remove ‘ERP003495.dir’: No such file or directory + rm /samples.tsv.ERP003495 rm: cannot remove ‘/samples.tsv.ERP003495’: No such file or directory + rm ERP003495.dir