Created
January 23, 2017 20:38
-
-
Save VorontsovIE/8817fcfd9fb24c4c1495c6ae174e3149 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
testfile=`realpath $1` | |
FEATURE=`echo $1 | xargs basename | sed -re 's/\.test\.tsv$//'` | |
CL=`echo $FEATURE | sed -re 's/^([^.]+)\..+$/\1/'` | |
if [ "$CL" == "all" ]; then | |
DIRNAME=`echo $1 | xargs dirname | xargs --replace echo {}/.. | xargs realpath` | |
train_file="${DIRNAME}/train/${FEATURE}.train.tsv" | |
fit_file="${DIRNAME}/fit_chr_not2_9_22/${FEATURE}.fit_chr_not2_9_22.tsv" | |
validation_file="${DIRNAME}/val_chr_2_9_22/${FEATURE}.val_chr_2_9_22.tsv" | |
ladder_file="${DIRNAME}/ladder/${FEATURE}.ladder.tsv" | |
else | |
DIRNAME=`echo $1 | xargs dirname | xargs --replace echo {}/../.. | xargs realpath` | |
train_file="${DIRNAME}/train/${CL}/${FEATURE}.train.tsv" | |
fit_file="${DIRNAME}/fit_chr_not2_9_22/${CL}/${FEATURE}.fit_chr_not2_9_22.tsv" | |
validation_file="${DIRNAME}/val_chr_2_9_22/${CL}/${FEATURE}.val_chr_2_9_22.tsv" | |
ladder_file="${DIRNAME}/ladder/${CL}/${FEATURE}.ladder.tsv" | |
fi | |
echo "paste /home/ivavlakul/dream/annotation/test_regions.blacklistfiltered.header.bed $testfile | grep -wEv '(chr1|chr8|chr21)' | cut -f4- > $train_file" | |
echo "paste /home/ivavlakul/dream/annotation/test_regions.blacklistfiltered.header.bed $testfile | grep -wEv '(chr1|chr8|chr21|chr2|chr9|chr22)' | cut -f4- > $fit_file" | |
echo "paste /home/ivavlakul/dream/annotation/test_regions.blacklistfiltered.header.bed $testfile | grep -wE '(chrom|chr2|chr9|chr22)' | cut -f4- > $validation_file" | |
echo "paste /home/ivavlakul/dream/annotation/test_regions.blacklistfiltered.header.bed $testfile | grep -wE '(chrom|chr1|chr8|chr21)' | cut -f4- > $ladder_file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment