Skip to content

Commit

Permalink
more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffersonfparil committed Jun 6, 2024
1 parent 5e157b2 commit 3056d89
Show file tree
Hide file tree
Showing 10 changed files with 66 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.github/
exec/tests/
exec/
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ po/*~
rsconnect/

# Test files
exec/tests/outdir/
exec/tests/outdir/
exec/tests/logfile
2 changes: 1 addition & 1 deletion R/main.R
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ gp = function(args) {
GENOMIC_PREDICTIONS = NA
} else {
### Find the best model in the args$population
df_agg = aggregate(corr ~ model, data=METRICS_WITHIN_POP, FUN=mean, na.rm=TRUE)
df_agg = stats::aggregate(corr ~ model, data=METRICS_WITHIN_POP, FUN=mean, na.rm=TRUE)
idx = which(df_agg$corr == max(df_agg$corr, na.rm=TRUE))[1]
model = df_agg$model[idx]
### Define additional model input/s
Expand Down
45 changes: 44 additions & 1 deletion exec/tests/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/bin/bash

#############
### GRAPE ###
#############
DIR='gp/exec/tests/'
cd $DIR
time \
Expand All @@ -17,7 +21,9 @@ Rscript ../gp.R \
--n-threads 32 \
--verbose TRUE


################
### RYEGRASS ###
################
DIR='/group/pasture/Jeff/gp/exec/tests'
cd $DIR
fname_geno='/group/pasture/Jeff/ryegrass/workdir/STR_NUE_WUE_HS-1717536141.3435302.3200855812-IMPUTED.tsv'
Expand Down Expand Up @@ -47,6 +53,43 @@ tail logfile
grep -A1 "ERROR:" logfile
ls -lhtr outdir/*.Rds


###############
### LUCERNE ###
###############
DIR='/group/pasture/Jeff/gp/exec/tests'
cd $DIR
fname_geno='/group/pasture/Jeff/lucerne/workdir/FINAL-IMPUTED-noTrailingAllele-filteredSNPlist.Rds'
fname_pheno='/group/pasture/Jeff/lucerne/workdir/Lucerne_PhenomicsDB_2024-05-27-BiomassPredicted.tsv'
n_traits=$(head -n1 $fname_pheno | awk '{print NF}')
touch outdir/lucerne/logfile
time \
for idx_pheno in $(seq 3 $n_traits)
do
time \
Rscript ../gp.R \
--fname-geno $fname_geno \
--fname-pheno $fname_pheno \
--population "DB-MS-31-22-001" \
--dir-output outdir/lucerne \
--pheno-idx-col-y $idx_pheno \
--bool-within TRUE \
--bool-across TRUE \
--n-folds 5 \
--n-reps 1 \
--bool-parallel TRUE \
--max-mem-Gb 60 \
--n-threads 32 \
--verbose TRUE >> outdir/lucerne/logfile
done
tail outdir/lucerne/logfile
grep -A1 "ERROR:" outdir/lucerne/logfile
ls -lhtr outdir/lucerne/*.Rds


########################################
### COMPLETE SET OF INPUT PARAMETERS ###
########################################
# Rscript ../gp.R \
# --fname-geno= \
# --fname-pheno= \
Expand Down
2 changes: 2 additions & 0 deletions man/fn_cross_validation_across_populations_bulk.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/fn_cross_validation_across_populations_lopo.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/fn_cross_validation_across_populations_pairwise.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/fn_cross_validation_within_population.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/fn_cv_1.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions man/gp.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3056d89

Please sign in to comment.