Skip to content

Commit 7891947

Browse files
committed
Changed setup.py to pyproject.toml
1 parent ca56b72 commit 7891947

File tree

6 files changed

+46
-62
lines changed

6 files changed

+46
-62
lines changed

example/tensorqtl_examples.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"output_type": "stream",
2929
"text": [
3030
"torch: 2.5.1+cu124 (CUDA 12.4), device: cuda\n",
31-
"pandas 2.2.3\n"
31+
"pandas: 2.2.3\n"
3232
]
3333
}
3434
],
@@ -83,7 +83,7 @@
8383
" * Computing associations\n",
8484
" Mapping chromosome chr18\n",
8585
" processing phenotype 301/301\n",
86-
" time elapsed: 0.05 min\n",
86+
" time elapsed: 0.04 min\n",
8787
" * writing output\n",
8888
"done.\n"
8989
]

install/requirements.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.

pyproject.toml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.setuptools]
6+
packages = ["tensorqtl"]
7+
8+
[project]
9+
name = "tensorqtl"
10+
version = "1.0.10"
11+
dependencies = [
12+
"numpy",
13+
"pandas",
14+
"Pgenlib>=0.90.1",
15+
"qtl",
16+
"scipy",
17+
"torch",
18+
]
19+
authors = [
20+
{name = "Francois Aguet", email = "[email protected]"}
21+
]
22+
maintainers = [
23+
{name = "Francois Aguet", email = "[email protected]"}
24+
]
25+
description = "GPU-accelerated QTL mapper"
26+
readme = "README.md"
27+
license = {file = "LICENSE"}
28+
keywords = ["Quantitative trait loci"]
29+
classifiers = [
30+
"Development Status :: 4 - Beta",
31+
"Programming Language :: Python :: 3",
32+
"Intended Audience :: Science/Research",
33+
"Topic :: Scientific/Engineering :: Bio-Informatics",
34+
]
35+
36+
[project.urls]
37+
Repository = "https://github.com/broadinstitute/tensorqtl.git"

setup.py

Lines changed: 0 additions & 42 deletions
This file was deleted.

tensorqtl/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
1-
__version__ = "1.0.10"
1+
import importlib.metadata
22
from .tensorqtl import *
3+
4+
__version__ = importlib.metadata.version(__name__)

tensorqtl/tensorqtl.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
import pickle
1010
import argparse
1111
from collections import defaultdict
12+
import importlib.metadata
1213

1314
sys.path.insert(1, os.path.dirname(__file__))
1415
from core import *
1516
from post import *
16-
from . import __version__
1717
import genotypeio, cis, trans, susie
1818

1919

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

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

0 commit comments

Comments
 (0)