Skip to content

Commit

Permalink
Changed setup.py to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
francois-a committed Nov 10, 2024
1 parent ca56b72 commit 7891947
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 62 deletions.
4 changes: 2 additions & 2 deletions example/tensorqtl_examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"output_type": "stream",
"text": [
"torch: 2.5.1+cu124 (CUDA 12.4), device: cuda\n",
"pandas 2.2.3\n"
"pandas: 2.2.3\n"
]
}
],
Expand Down Expand Up @@ -83,7 +83,7 @@
" * Computing associations\n",
" Mapping chromosome chr18\n",
" processing phenotype 301/301\n",
" time elapsed: 0.05 min\n",
" time elapsed: 0.04 min\n",
" * writing output\n",
"done.\n"
]
Expand Down
13 changes: 0 additions & 13 deletions install/requirements.txt

This file was deleted.

37 changes: 37 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[tool.setuptools]
packages = ["tensorqtl"]

[project]
name = "tensorqtl"
version = "1.0.10"
dependencies = [
"numpy",
"pandas",
"Pgenlib>=0.90.1",
"qtl",
"scipy",
"torch",
]
authors = [
{name = "Francois Aguet", email = "[email protected]"}
]
maintainers = [
{name = "Francois Aguet", email = "[email protected]"}
]
description = "GPU-accelerated QTL mapper"
readme = "README.md"
license = {file = "LICENSE"}
keywords = ["Quantitative trait loci"]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Bio-Informatics",
]

[project.urls]
Repository = "https://github.com/broadinstitute/tensorqtl.git"
42 changes: 0 additions & 42 deletions setup.py

This file was deleted.

4 changes: 3 additions & 1 deletion tensorqtl/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
__version__ = "1.0.10"
import importlib.metadata
from .tensorqtl import *

__version__ = importlib.metadata.version(__name__)
8 changes: 4 additions & 4 deletions tensorqtl/tensorqtl.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
import pickle
import argparse
from collections import defaultdict
import importlib.metadata

sys.path.insert(1, os.path.dirname(__file__))
from core import *
from post import *
from . import __version__
import genotypeio, cis, trans, susie


Expand Down Expand Up @@ -59,7 +59,7 @@ def main():
raise ValueError("Interactions are only supported in 'cis_nominal' or 'trans' mode.")

logger = SimpleLogger(os.path.join(args.output_dir, f'{args.prefix}.tensorQTL.{args.mode}.log'))
logger.write(f'[{datetime.now().strftime("%b %d %H:%M:%S")}] Running TensorQTL v{__version__}: {args.mode.split("_")[0]}-QTL mapping')
logger.write(f'[{datetime.now().strftime("%b %d %H:%M:%S")}] Running TensorQTL v{importlib.metadata.version("tensorqtl")}: {args.mode.split("_")[0]}-QTL mapping')
if torch.cuda.is_available():
logger.write(f' * using GPU ({torch.cuda.get_device_name(torch.cuda.current_device())})')
else:
Expand Down Expand Up @@ -230,14 +230,14 @@ def main():
summary_df = pd.read_csv(args.cis_output, sep='\t', index_col=0)
summary_df.rename(columns={'minor_allele_samples':'ma_samples', 'minor_allele_count':'ma_count'}, inplace=True)
if args.chunk_size is None:
res_df = cis.map_independent(genotype_df, variant_df, summary_df, phenotype_df, phenotype_pos_df, covariates_df,
res_df = cis.map_independent(genotype_df, variant_df, summary_df, phenotype_df, phenotype_pos_df, covariates_df=covariates_df,
group_s=group_s, fdr=args.fdr, nperm=args.permutations, window=args.window,
maf_threshold=maf_threshold, logger=logger, seed=args.seed, verbose=True)
else:
res_df = []
for gt_df, var_df, p_df, p_pos_df, _ in genotypeio.generate_paired_chunks(pgr, phenotype_df, phenotype_pos_df, args.chunk_size,
dosages=args.dosages, verbose=True):
res_df.append(cis.map_independent(gt_df, var_df, summary_df, p_df, p_pos_df, covariates_df,
res_df.append(cis.map_independent(gt_df, var_df, summary_df, p_df, p_pos_df, covariates_df=covariates_df,
group_s=group_s, fdr=args.fdr, nperm=args.permutations, window=args.window,
maf_threshold=maf_threshold, logger=logger, seed=args.seed, verbose=True))
res_df = pd.concat(res_df).reset_index(drop=True)
Expand Down

0 comments on commit 7891947

Please sign in to comment.