sysbio-vo / bnfinder

BNFinder - tool for learning bayesian networks
GNU General Public License v2.0
50 stars 8 forks source link

Bif as input file #1

Closed sonujose123 closed 7 years ago

sonujose123 commented 7 years ago

Is there any way to input file format in bif or any online conversion tool available for converting bif to your input file format. (input1.txt)?

alnf commented 7 years ago

Let me clarify what do you mean exactly.

https://github.com/sysbio-vo/bnfinder/blob/master/doc/data/input1.txt is a simple tab separated value format with one exception - first line. In first line you can pass different parameters, the description of which you can read in doc file (compile from latex in doc folder or use a little bit older version here - http://bioputer.mimuw.edu.pl/software/bnf/bnfinder_doc.pdf).

"#regulators P1 P2" denotes that nodes P1 and P2 are outbounding, which is a crucial part of algorithm as structural constraints forcing network’s acyclicity are necessery for learning a static Bayesian network with BNfinder (again, check the doc).

The rest of the input1.txt file (which is tsv format actually) is your observations, where in rows you have your variables and in columns - your conditions. So, at this point of time you don't have network structure, you rather have observational data, and after launching bnfinder on your data you will get network in SIF format.

So, please, give me an example of what you want to pass as input file, so I can answer your question more clearly.

sonujose123 commented 7 years ago

Thank you for the quick response. I would like to give "ASIA" data as an example. It will be great if you could help with this data.

On Mon, Dec 5, 2016 at 1:25 AM, aln notifications@github.com wrote:

Let me clarify what do you mean exactly.

https://github.com/sysbio-vo/bnfinder/blob/master/doc/data/input1.txt is a simple tab separated value format with one exception - first line. In first line you can pass different parameters, the description of which you can read in doc file (compile from latex in doc folder or use a little bit older version here - http://bioputer.mimuw.edu.pl/ software/bnf/bnfinder_doc.pdf).

"#regulators P1 P2" denotes that nodes P1 and P2 are outbounding, which is a crucial part of algorithm as structural constraints forcing network’s acyclicity are necessery for learning a static Bayesian network with BNfinder (again, check the doc).

The rest of the input1.txt file (which is tsv format actually) is your observations, where in rows you have your variables and in columns - your conditions. So, at this point of time you don't have network structure, you rather have observational data, and after launching bnfinder on your data you will get network in SIF format.

So, please, give me an example of what you want to pass as input file, so I can answer your question more clearly.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sysbio-vo/bnfinder/issues/1#issuecomment-264804655, or mute the thread https://github.com/notifications/unsubscribe-auth/AQjW7fZ9nskiVrYN7UPzuPGJsZrwM3Lpks5rE9h-gaJpZM4LDz7U .

alnf commented 7 years ago

Is it from bnlearn R package? If yes, then you should:

  1. Transpose the matrix, so you will have variables as rows and observations as columns.
  2. Convert yes to 1, and no to 0.
  3. Save matrix as tab separated file (you can give any file name extension)
  4. Add the mandatory config line at the beginning. For example "#regulators A S", which would mean that visit to Asia and smoking are the main regulatory factors, i.e. nodes with outgoing edges.
  5. Check if the file looks similar to input1.txt in terms of format.

Again, for inferring static networks with BNFiner you will have to ensure the acyclicity of the graph by providing regulatory nodes. For dynamic networks inferring (which means your data have to be of a time-series nature) read the doc link I posted above. We use "regulators" term here, because the primary application of BNFinder is biological networks inference, where regulators are genes/proteins, which regulate other genes/proteins.

sonujose123 commented 7 years ago

Yes. It is.

I have attached the ASIA file for your kind reference.

I have attached asia.bif too.

Thank you!

On Mon, Dec 5, 2016 at 2:07 PM, aln notifications@github.com wrote:

Is it from bnlearn R package?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sysbio-vo/bnfinder/issues/1#issuecomment-264993241, or mute the thread https://github.com/notifications/unsubscribe-auth/AQjW7esHFPbk3oKZPjfkUbaelcCk_cgtks5rFIsGgaJpZM4LDz7U .

alnf commented 7 years ago

I don't see attached files, but I checked the ASIA data in R, so you may try to follow my instructions.

sonujose123 commented 7 years ago

Ok. Thank you. On Dec 5, 2016 2:27 PM, "aln" notifications@github.com wrote:

I don't see attached files, but I checked the ASIA data in R, so you may try to follow my instructions.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sysbio-vo/bnfinder/issues/1#issuecomment-264998306, or mute the thread https://github.com/notifications/unsubscribe-auth/AQjW7RdsFpXAMT6HtrpAV_7jDK9jIi1Dks5rFI_ugaJpZM4LDz7U .

alnf commented 7 years ago

If you're writing replies by answering via email, then probably you cannot attach files (not sure, only tried web attachment): https://help.github.com/articles/file-attachments-on-issues-and-pull-requests/

sonujose123 commented 7 years ago

asia.bif.gz ASIA.xlsx

alnf commented 7 years ago

Have you succeeded in testing ASIA data with BNFinder? May I close the issue?

sonujose123 commented 7 years ago

Yes please. On Dec 11, 2016 11:08 AM, "aln" notifications@github.com wrote:

Have you succeeded in testing ASIA data with BNFinder? May I close the issue?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/sysbio-vo/bnfinder/issues/1#issuecomment-266300584, or mute the thread https://github.com/notifications/unsubscribe-auth/AQjW7SP-NNHhjANzD8uWPGgV4Pzf65bJks5rHEoegaJpZM4LDz7U .

alnf commented 7 years ago

Thanks, feel free to create more issues in case of troubles:)