Skip to content

Commit

Permalink
fix bug when no vcf is used in search and graphical general table
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelecancellieri committed Apr 21, 2022
1 parent 64a41ae commit fd57480
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ samplesIDs/*
guides/
*.csv
PostProcess/CRISTA_predictors.pkl
*.txt
1 change: 1 addition & 0 deletions PostProcess/process_summaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def init_summary_by_sample(path_samplesID):
dict_pop = {}
dict_superpop = {}
with open(f"{path_samplesID}", "r") as sid:
# print('pathid',path_samplesID)
sid.readline()
for line in sid:
splitted = line.strip().split("\t")
Expand Down
2 changes: 2 additions & 0 deletions PostProcess/resultIntegrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,7 @@ def createBedforMultiAlternative(variantList, samples):
if base_end>0 and base_end<=len(saveDict['Spacer+PAM']):
end=base_end

# print('basestart:',base_start,' baseend:',base_end)
if saveDict['REF/ALT_origin_(highest_CFD)'] == 'alt':
value=base_counting(saveDict['Aligned_protospacer+PAM_ALT_(highest_CFD)'],start-1,end)
#check count A
Expand Down Expand Up @@ -948,6 +949,7 @@ def createBedforMultiAlternative(variantList, samples):
if check_personal_existence:
columns_to_remove.remove(columns_of_dict.index('Annotation_personal')+1)
for base in base_set.strip().split(','):
# print('base',base)
if base == '_':
break
base=base.upper()
Expand Down
7 changes: 4 additions & 3 deletions PostProcess/submit_job_automated_new_multiple_vcfs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -456,9 +456,10 @@ while read samples; do
# tail -n +2 $samples >> "$output_folder/.sampleID.txt"
grep -v '#' "${current_working_directory}/samplesIDs/$samples" >>"$output_folder/.sampleID.txt"
done <$sampleID
if [ "$vcf_name" != "_" ]; then
sed -i 1i"#SAMPLE_ID\tPOPULATION_ID\tSUPERPOPULATION_ID\tSEX" "$output_folder/.sampleID.txt"
fi
# if [ "$vcf_name" != "_" ]; then
touch "$output_folder/.sampleID.txt"
sed -i 1i"#SAMPLE_ID\tPOPULATION_ID\tSUPERPOPULATION_ID\tSEX" "$output_folder/.sampleID.txt"
# fi

sampleID=$output_folder/.sampleID.txt

Expand Down
3 changes: 2 additions & 1 deletion pages/main_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ def change_url(
with open(os.path.join(result_dir, ".list_vcfs.txt"), mode="w") as handle_vcf:
if not ref_var:
vcf_folder = "_"
handle_vcf.write(f"{vcf_folder}\n")
if VARIANTS_DATA[0] in ref_var: # 1000 genomes
vcf_folder = "hg38_1000G"
sample_list.append("hg38_1000G.samplesID.txt") # 1KGP samples
Expand Down Expand Up @@ -608,7 +609,7 @@ def change_url(
else:
be_start = int(be_start)
if be_stop is None or not bool(be_stop):
be_stop = 1
be_stop = 0
else:
be_stop = int(be_stop)
if be_nt is None or not bool(be_nt):
Expand Down
2 changes: 1 addition & 1 deletion pages/pages_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@
# CRISPR guides file
GUIDES_FILE = ".guides.txt"
# sample IDs file
SAMPLES_FILE = ".sampleID.txt"
SAMPLES_FILE = ".samplesID.txt"
# PAMs file
PAMS_FILE = ".pam.txt"
# email file
Expand Down
5 changes: 2 additions & 3 deletions pages/results_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -2906,9 +2906,8 @@ def update_table_general_profile(
data_guides[str(i) + "MM"] = "\n".join(tmp)
else:
for j in range(mms + 1):
tmp = [
data_general_count.iloc[: (max_bulges + 1), j].values.astype(str)
]
tmp = list(data_general_count.iloc[:, j].values.astype(str))
tmp=tmp[:max_bulges+1]
# tmp.insert(len(tmp)//2, "")
data_guides[str(j) + "MM"] = "\n".join(tmp)
data_guides["Total"] = "\n".join(data_guides["Total"])
Expand Down

0 comments on commit fd57480

Please sign in to comment.