Skip to content

Commit 3fc0587

Browse files
authored
Merge pull request #10 from Center-for-Health-Data-Science/server_snapshot
Only track whitelisted .yaml configuration files and .py execs are made directly runnable. Fixed DEA.
2 parents 5523bcc + ebdea82 commit 3fc0587

File tree

6 files changed

+30
-4
lines changed

6 files changed

+30
-4
lines changed

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,15 @@ venv.bak/
4848

4949
# MacOS
5050
.DS_Store
51+
52+
# downloaded decoder
53+
dec.pth
54+
55+
# only keep whitelisted set of config files
56+
bulkDGD/ioutil/configs/*.yaml
57+
!model.yaml
58+
!pca_scatter.yaml
59+
!r_values_hist.yaml
60+
!time_line.yaml
61+
!one_opt.yaml
62+
!two_opt.yaml

bulkDGD/analysis/dea.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -793,17 +793,15 @@ def get_log2_fold_changes(obs_counts,
793793
# should return the columns in the order specified by the
794794
# selection.
795795
obs_counts = \
796-
torch.Tensor(obs_counts.loc[genes_obs].astype("int").values)
797-
796+
torch.tensor(obs_counts.loc[genes_obs].astype("float").values)
798797
#-----------------------------------------------------------------#
799798

800799
# Create a tensor containing only those columns containing gene
801800
# expression data for the predicted mean counts - the 'loc' syntax
802801
# should return the columns in the order specified by the
803802
# selection.
804803
pred_means = \
805-
torch.Tensor(pred_means.loc[genes_obs].astype("int").values)
806-
804+
torch.tensor(pred_means.loc[genes_obs].astype("float").values)
807805
#-----------------------------------------------------------------#
808806

809807
# Get the mean gene counts for the sample.

bulkDGD/execs/dgd_get_probability_density.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,3 +369,6 @@ def main():
369369
"were successfully written in " \
370370
f"'{output_csv_prob_comp_path}'."
371371
log.info(infostr)
372+
373+
if __name__ == "__main__":
374+
main()

bulkDGD/execs/dgd_get_representations.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,3 +456,6 @@ def main():
456456
"The time data were successfully written in " \
457457
f"'{output_csv_time_path}'."
458458
log.info(infostr)
459+
460+
if __name__ == "__main__":
461+
main()

bulkDGD/execs/dgd_perform_dea.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,10 @@ def main():
435435
# Get the data frame containing the DEA results for the
436436
# current sample and the name of the sample.
437437
df_stats, sample_name = result
438+
df_stats["obs_counts"] = obs_counts.loc[sample_name,:]
439+
df_stats["dgd_mean"] = pred_means.loc[sample_name,:]
440+
df_stats["dgd_r"] = r_values
441+
438442

439443
# Set the path to the output file.
440444
output_csv_path = \
@@ -465,3 +469,6 @@ def main():
465469
f"The DEA results for sample '{sample_name}' were " \
466470
f"successfully written in '{output_csv_path}'."
467471
log.info(infostr)
472+
473+
if __name__ == "__main__":
474+
main()

bulkDGD/execs/dgd_preprocess_samples.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,3 +337,6 @@ def main():
337337
"was successfully written in " \
338338
f"'{output_txt_genes_missing_path}'."
339339
log.info(infostr)
340+
341+
if __name__ == "__main__":
342+
main()

0 commit comments

Comments
 (0)