diff --git a/freyja/_cli.py b/freyja/_cli.py index 9f7a6b41..39020a42 100644 --- a/freyja/_cli.py +++ b/freyja/_cli.py @@ -64,7 +64,9 @@ def update(): df_barcodes = convert_to_barcodes(df) df_barcodes = reversion_checking(df_barcodes) df_barcodes.to_csv(os.path.join(locDir, 'data/usher_barcodes.csv')) - # TODO: delete files generated along the way + # delete files generated along the way that aren't needed anymore + os.remove(lineagePath) + os.remove(os.path.join(locDir, "data/public-latest.all.masked.pb.gz")) @cli.command() diff --git a/freyja/sample_deconv.py b/freyja/sample_deconv.py index f1094e31..f432433c 100644 --- a/freyja/sample_deconv.py +++ b/freyja/sample_deconv.py @@ -41,7 +41,7 @@ def build_mix_and_depth_arrays(fn, depthFn, muts): def reindex_dfs(df_barcodes, mix, depths): # first, drop Nextstrain clade names. - nxNames = ['20A', '20C', '20D', '20H(Beta,V2)', '21C(Epsilon)'] + nxNames = df_barcodes.index[df_barcodes.index.str[0].str.isdigit()] dropList = set(nxNames) & set(df_barcodes.index) df_barcodes = df_barcodes.drop(index=dropList) # reindex everything to match across the dfs diff --git a/freyja/updates.py b/freyja/updates.py index f7b80326..4a6be100 100644 --- a/freyja/updates.py +++ b/freyja/updates.py @@ -13,7 +13,6 @@ def download_tree(): def convert_tree(): - print('Converting tree into barcodes',) locDir = os.path.abspath(os.path.join(os.path.realpath(__file__), os.pardir)) treePath = os.path.join(locDir, "data/public-latest.all.masked.pb.gz") @@ -25,7 +24,6 @@ def convert_tree(): def get_curated_lineage_data(): locDir = os.path.abspath(os.path.join(os.path.realpath(__file__), os.pardir)) - print('Downloading an updated curated lineage set from outbreak.info') url2 = "https://raw.githubusercontent.com/outbreak-info/outbreak.info/"\ "master/web/src/assets/genomics/curated_lineages.json" urllib.request.urlretrieve(url2, diff --git a/preprocess.sh b/preprocess.sh deleted file mode 100644 index 72e3dc00..00000000 --- a/preprocess.sh +++ /dev/null @@ -1,23 +0,0 @@ -bamfolder=$1 -varfolder=$2 -depthfolder=$3 -# echo "${depthfolder}" -if [[ $# -eq 0 ]] ; then - echo 'Need to supply input arguments.' - exit 1 -fi - -for fn in $1/* ## bamfiles/* -do - # echo "${fn}" - # echo "${fn%.*}" - # echo "${fn##*/}" - fn_out=${fn##*/} - baseName=${fn##*/} - baseName=${baseName%.*} - echo $depthfolder$baseName - samtools mpileup -aa -A -d 600000 -Q 20 -q 0 -B -f NC_045512_Hu-1.fasta ${fn} | tee >(cut -f1-4 > ${depthfolder}${fn_out%.*}.depth) | ivar variants -p $depthfolder$baseName -q 20 -r NC_045512_Hu-1.fasta - # samtools mpileup -A -aa -d 600000 -Q 20 -q 0 -B -f NC_045512_Hu-1.fasta ${fn} | cut -f1-4 > ${depthfolder}${fn_out%.*}.depth #& -done - -