hakyimlab / summary-gwas-imputation

harmonization, liftover, and imputation of summary statistics from GWAS
MIT License
31 stars 20 forks source link

AttributeError: 'DataFrame' object has no attribute 'sample_size' #21

Open github-wzchhh opened 12 months ago

github-wzchhh commented 12 months ago

this is my data format variant_id chromosome base_pair_location effect_allele other_allele beta standard_error p_value variant_id_hg19 base_pair_location_grch38 sample_size frequency rs144804129 chr10 100000122 A T -0.271 0.4979 0.5863 10_100000122_T_A 98240365 10000
rs6602381 chr10 10000018 G A -8e-04 0.0143 0.955 10_10000018_A_G 9958055 10000
rs11442554 chr10 100000554 AT A 0.0281 0.0217 0.1945 10_100000554_A_AT 98240797 10000
rs112832083 chr10 100000588 C T -0.5309 0.9955 0.5938 10_100000588_T_C 98240831 10000
rs7899632 chr10 100000625 G A -0.007 0.0153 0.6492 10_100000625_A_G 98240868 10000
rs61875309 chr10 100000645 C A 0.0042 0.0194 0.8272 10_100000645_A_C 98240888 10000
rs150203744 chr10 100001867 T C -0.0458 0.0893 0.6083 10_100001867_C_T 98242110 10000
rs8181398 chr10 100002399 G A -0.856 0.5069 0.09125 10_100002399_A_G 98242642 10000
rs145421501 chr10 100002418 G C -0.2714 0.4991 0.5866 10_100002418_C_G 98242661 10000

this is my code $python $GWAS_TOOLS/gwas_parsing.py \

    -gwas_file $DATA/GCST90132223_buildGRCh37_for_harm.txt \
    -snp_reference_metadata /home/data/t010406/TWAS/data/reference_panel_1000G/variant_metadata.txt.gz METADATA \
    -output_column_map variant_id rsid \
    -output_column_map other_allele non_effect_allele \
    -liftover /home/data/t010406/TWAS/data/liftover/hg19ToHg38.over.chain.gz \
    -output_column_map effect_allele effect_allele \
    -output_column_map p_value  pvalue \
    -output_column_map frequency frequency\
    -output_column_map chromosome chromosome \
    -output_column_map beta effect_size \
    --chromosome_format \
    -output_column_map base_pair_location position \
    -output_order  rsid panel_variant_id chromosome position effect_allele non_effect_allele frequency pvalue  effect_size standard_error  zscore  \
    -output $OUTPUT/harmonized_gwas/Multi_All_RA_harmonized.txt.gz

INFO - Parsing input GWAS INFO - loaded 10000 variants INFO - Performing liftover

INFO - 10000 variants after liftover INFO - Creating index to attach reference ids INFO - Acquiring reference metadata INFO - alligning alleles INFO - 0 variants after restricting to reference variants INFO - Ensuring variant uniqueness INFO - 0 variants after ensuring uniqueness INFO - Checking for missing frequency entries Traceback (most recent call last): File "/home/data/t010406/TWAS/summary-gwas-imputation-master/src/gwas_parsing.py", line 311, in run(args) File "/home/data/t010406/TWAS/summary-gwas-imputation-master/src/gwas_parsing.py", line 283, in run d = clean_up(d) File "/home/data/t010406/TWAS/summary-gwas-imputation-master/src/gwas_parsing.py", line 243, in clean_up d = d.assign(sample_size=[int(x) if not math.isnan(x) else "NA" for x in d.sample_size]) File "/home/data/t010406/miniconda3/envs/imlabtools/lib/python3.7/site-packages/pandas/core/generic.py", line 5179, in getattr return object.getattribute(self, name) AttributeError: 'DataFrame' object has no attribute 'sample_size'

may I ask why this error happened? thanks, jack