Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metaxcan erros issue template #131

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/metaxcan-errors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Metaxcan errors
about: Use this template to raise an issue on error related to MetaXcan software family
title: ''
labels: ''
assignees: ''

---

# Instant help
Search your error message on the [FAQ](https://predictdb.org/categories/faq/) for instant help. If you can't find it proceed with the next steps below.

# System info
- Operating system : [Mac, Linux, Windows]
- OS version:
- Did you install and use this [conda env](https://github.com/hakyimlab/MetaXcan/blob/master/software/conda_env.yaml)?

# Error info
- Paste the specific command you used

- Rerun the command and set `--verbosity 7` and paste the error log here

- Headers of your input files

- Genome build of your input files

- Any other important info
5 changes: 5 additions & 0 deletions software/Predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ def run(args):

logging.info("Loading model")
model, weights, extra = model_structure(args)

if args.shuffle_weights:
logging.info("Shuffling weights in model")
weights["weight"] = weights.groupby("gene")["weight"].transform(numpy.random.permutation)

variant_mapping = get_variant_mapping(args, weights)

Expand Down Expand Up @@ -256,6 +260,7 @@ def add_arguments(parser):
parser.add_argument("--sub_batch", help="compute on a specific slice of data", type=int, default=None)
parser.add_argument("--only_entries", help="Compute only these entries in the models (e.g. a whitelist of genes)", nargs="+")
parser.add_argument("--capture")
parser.add_argument('--shuffle_weights', action="store_true", help="shuffle model weights to check for inflation")

if __name__ == "__main__":
import argparse
Expand Down
1 change: 1 addition & 0 deletions software/SPrediXcan.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def run(args):
parser.add_argument("--overwrite", help="If set, will overwrite the results file if it exists.", action="store_true", default=False)
parser.add_argument("--additional_output", help="If set, will output additional information.", action="store_true", default=False)
parser.add_argument("--MAX_R", help="Run only for the first R genes", type=int, default=None)
parser.add_argument('--shuffle_weights', action="store_true", help="shuffle model weights to check for inflation")

args = parser.parse_args()

Expand Down
4 changes: 4 additions & 0 deletions software/metax/metaxcan/Utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ def build_context(args, gwas):
logging.info("Loading model from: %s", args.model_db_path)
model = load_model(args.model_db_path, args.model_db_snp_key)

if args.shuffle_weights:
logging.info("Shuffling weights in model")
model.weights["weight"] = model.weights.groupby("gene")["weight"].transform(numpy.random.permutation)

if not args.single_snp_model:
if not args.stream_covariance:
logging.info("Loading covariance data from: %s", args.covariance)
Expand Down