rmarkello / abagen

A toolbox for working with Allen Human Brain Atlas microarray expression data
https://abagen.readthedocs.io
BSD 3-Clause "New" or "Revised" License
93 stars 41 forks source link

Output normalized values #187

Closed HusBunia closed 3 years ago

HusBunia commented 3 years ago

Hi

I have some questions about my output. The code I used to output the matrix was

expression = abg.get_expression_data('new500.nii',donors='all',data_dir='D:\SomeData\AIBS\microarray',sample_norm='center',exact=False)

The 'center' option also gave me the expression value between 0 to 1. Does sigmoid normalization work for the option?

Thanks for your help

rmarkello commented 3 years ago

Hi @HusBunia !

Setting sample_norm='center' is going to perform centering (i.e., subtract the mean) of each tissue sample across genes. There is the separate gene_norm parameter which controls normalization of each gene across tissue samples (relevant docs). By default, sample_norm and gene_norm are both 'srs', so if you'd like to use centering I suggest you set both parameters to 'center'—then you should find your outputs will no longer be scaled to the unit interval!

Updating your code to reflect that would look like:

expression = abg.get_expression('new500.nii', donors='all', data_dir='D:\SomeData\AIBS\microarray', sample_norm='center', gene_norm='center', exact=False)

(Note that as of abagen version 0.1 the exact parameter is deprecated and has been replaced by the missing parameter, so if you are using a recent version of abagen you should replace exact=False with missing="centroids"—though both should work identically!)

Let me know if you have any more questions about this or if this solves your problem :smile:

HusBunia commented 3 years ago

Many thanks for your help! I have learned that

------------------ Original ------------------ From: Ross Markello @.> Date: Thu,Apr 22,2021 3:10 AM To: rmarkello/abagen @.> Cc: HusBunia @.>, Mention @.> Subject: Re: [rmarkello/abagen] Output normalized values (#187)

Hi @HusBunia !

Setting sample_norm='center' is going to perform centering (i.e., subtract the mean) of each tissue sample across genes. There is the separate gene_norm parameter which controls normalization of each gene across tissue samples (relevant docs). By default, sample_norm and gene_norm are both 'srs', so if you'd like to use centering I suggest you set both parameters to 'center'—then you should find your outputs will no longer be scaled to the unit interval!

Updating your code to reflect that would look like: expression = abg.get_expression('new500.nii', donors='all', data_dir='D:\SomeData\AIBS\microarray', sample_norm='center', gene_norm='center', exact=False)

(Note that as of abagen version 0.1 the exact parameter is deprecated and has been replaced by the missing parameter, so if you are using a recent version of abagen you should replace exact=False with missing="centroids"—though both should work identically!)

Let me know if you have any more questions about this or if this solves your problem 😄

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.