+ date=2019-10-01 + data_source=data_sources + organism='Homo sapiens' ++ dirname ../prep/study_metadata_layout.sh + sdir=../prep + study=ERP109044 + org=human + dsource=sra + preds_file=../prep/Human.SRA_curated_predict.meta.w_rids.rtypes.tsv + perl -e '$study="ERP109044"; $study=~/(..)$/; $lo=$1; `mkdir -p $lo/$study`; print "$lo/$study\n";' ++ cat ERP109044.dir + dir=44/ERP109044 + cat ../prep/samples.tsv.header /dev/fd/63 ++ fgrep ' ERP109044 ' ../prep/samples.tsv + cut_cols=1-3 + [[ human == \m\o\u\s\e ]] + [[ human == \h\u\m\a\n ]] + gzip + cut -f 1-41 44/ERP109044/samples.tsv.ERP109044 cut: 44/ERP109044/samples.tsv.ERP109044: No such file or directory + cut -f 1-3,42-150 44/ERP109044/samples.tsv.ERP109044 + gzip cut: 44/ERP109044/samples.tsv.ERP109044: 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 44/ERP109044/samples.tsv.ERP109044 ++ 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 ‘44/ERP109044/samples.tsv.ERP109044’ 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 ../prep/Human.SRA_curated_predict.meta.w_rids.rtypes.tsv ++ fgrep ' ERP109044 ' ../prep/Human.SRA_curated_predict.meta.w_rids.rtypes.tsv ++ perl -e '$s="ERP109044"; $s=~/(..)$/; $lo=$1; print "$lo\n";' + lo=44 + gzip + cat /dev/fd/63 /dev/fd/62 ++ head -1 ../prep/seqtk.w_study.tsv.cut ++ fgrep ' ERP109044 ' ../prep/seqtk.w_study.tsv.cut + rm 44/ERP109044/samples.tsv.ERP109044 rm: cannot remove ‘44/ERP109044/samples.tsv.ERP109044’: No such file or directory + rm ERP109044.dir rm: cannot remove ‘ERP109044.dir’: No such file or directory