Skip to content
Snippets Groups Projects
Commit 738e0fb5 authored by not populated not populated's avatar not populated not populated
Browse files

Changed to using short project id, version comes after project id, per-family...

Changed to using short project id, version comes after project id, per-family PED and CSV files move to results/project_version/params folder
parent 08cfee1a
No related branches found
No related tags found
1 merge request!3Ultra 2 SOP/doc updates
......@@ -54,9 +54,15 @@ cat $DOWNLOAD_DIR/$PROJECT_ID/*/file_list.tsv | \
--ped $PROJECT_ID.ped \
--suffix $SAMPLE_SUFFIX
SHORT_PROJECT_ID=`echo $PROJECT_ID | cut -f 1 -d '_'`
mkdir -p ${OUTPUT_DIR}/${SHORT_PROJECT_ID}_${VERSION}/params
for FAMILY_ID in `cat ${PROJECT_ID}.family_ids.txt`
do
echo "samplename,description,batch,sex,phenotype,variant_regions" > ${VERSION}_${PROJECT_ID}_${FAMILY_ID}.csv
PREFIX=${SHORT_PROJECT_ID}_${VERSION}_${FAMILY_ID}
echo "samplename,description,batch,sex,phenotype,variant_regions" > ${PREFIX}.csv
COUNT=`wc -l ${PROJECT_ID}_${FAMILY_ID}.ped | awk '{ print $1 }'`
for ((i=1; i<=$COUNT; i=i+1))
......@@ -90,26 +96,28 @@ do
for FILE in `ls $READS_DIR/$PROJECT_ID/symlinks/$SAMPLE/*_R[1,2].fastq.gz`
do
echo "$FILE,$SAMPLE,$FAMILY_ID,$SEX,$PHENOTYPE,$TARGET" >> ${VERSION}_${PROJECT_ID}_${FAMILY_ID}.csv
echo "$FILE,$SAMPLE,$FAMILY_ID,$SEX,$PHENOTYPE,$TARGET" >> ${PREFIX}.csv
done
done
bcbio_prepare_samples.py --out $READS_DIR/$PROJECT_ID --csv ${VERSION}_${PROJECT_ID}_${FAMILY_ID}.csv
bcbio_prepare_samples.py --out $READS_DIR/$PROJECT_ID --csv ${PREFIX}.csv
mv ${VERSION}_${PROJECT_ID}_${FAMILY_ID}-merged.csv ${VERSION}_${PROJECT_ID}_${FAMILY_ID}.csv
mv ${PREFIX}-merged.csv ${PREFIX}.csv
BARE_FAMILY_ID=`echo $FAMILY_ID | cut -d '_' -f 2`
bcbio_nextgen.py -w template $BCBIO_TEMPLATE ${VERSION}_${PROJECT_ID}_${FAMILY_ID}.csv $READS_DIR/$PROJECT_ID/*_${BARE_FAMILY_ID}_R[12].fastq.gz
bcbio_nextgen.py -w template $BCBIO_TEMPLATE ${PREFIX}.csv $READS_DIR/$PROJECT_ID/*_${BARE_FAMILY_ID}_R[12].fastq.gz
mv ${VERSION}_${PROJECT_ID}_${FAMILY_ID}/config/${VERSION}_${PROJECT_ID}_${FAMILY_ID}.yaml $CONFIG_DIR/
mv ${PREFIX}/config/${PREFIX}.yaml $CONFIG_DIR/
COMPRESSED_ID=`echo "$FAMILY_ID" | perl -pe "s/\_//"`
perl -i -pe "s/${COMPRESSED_ID}/${FAMILY_ID}/" $CONFIG_DIR/${VERSION}_${PROJECT_ID}_${FAMILY_ID}.yaml
perl -i -pe "s/${COMPRESSED_ID}/${FAMILY_ID}/" $CONFIG_DIR/${PREFIX}.yaml
rm -r ${VERSION}_${PROJECT_ID}_${FAMILY_ID}
rm -r ${PREFIX}
mv ${PREFIX}.csv ${OUTPUT_DIR}/${SHORT_PROJECT_ID}_${VERSION}/params/
mv ${PROJECT_ID}_${FAMILY_ID}.ped ${OUTPUT_DIR}/${SHORT_PROJECT_ID}_${VERSION}/params/
done
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment