Skip to content

Commit

Permalink
Fix document of package PyRice
Browse files Browse the repository at this point in the history
  • Loading branch information
hongquando committed Oct 22, 2019
1 parent 0f22a9b commit be09bb6
Show file tree
Hide file tree
Showing 6 changed files with 148 additions and 94 deletions.
218 changes: 133 additions & 85 deletions .idea/workspace.xml

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/source/pyrice_module.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Pyrice module
=============

pyrice.build_dictionary module
pyrice.build\_dictionary module
-------------------------------

.. automodule:: pyrice.build_dictionary
:members:
:undoc-members:
:show-inheritance:

pyrice.multi_query module
pyrice.multi\_query module
--------------------------

.. automodule:: pyrice.multi_query
Expand Down
Binary file modified pyrice/__pycache__/multi_query.cpython-36.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion pyrice/database_description.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<prettify replaceBy='\s'>\n>LOC_.*\n|\n|\r|\t</prettify>
</database>

<database dbname="arabidpsis" type="text/html" method="GET">
<database dbname="arabidopsis" type="text/html" method="GET">
<link stern="https://www.arabidopsis.org/servlets/TairObject?" aft="&amp;type=locus"/>
<headers>
<header type="">Representative Gene Model</header>
Expand Down
12 changes: 9 additions & 3 deletions pyrice/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@
args = parser.parse_args()

if __name__ == "__main__":
# # Search gene and query loc
# Search gene and query loc
query = MultiQuery()
result = query.search_on_chromosome(chro="chr01", start_pos="1",
end_pos="20000", number_process = 4, dbs="all", save_path="./result/")
print("Output database:", result)


# # Query with chromosome
# Query with chromosome
query = MultiQuery()
result = query.query_by_chromosome(chro="chr01", start_pos="1",
end_pos="20000", number_process = 4, multi_processing=True, multi_threading=True,
Expand All @@ -43,13 +43,19 @@
# query.save(result,save_path = "./result/",format=["csv","html","json","pkl"],hyper_link=False)
# print("Output database:",result)

# # Query with new database
# Query with new database
# query = MultiQuery()
# result = query.query_new_database(atts=['TRAES3BF001000010CFD'], number_process= 4,
# multi_processing=True,multi_threading=True,dbs=['urgi'])
# query.save(result, save_path="./result/", format=["csv", "html", "json", "pkl"], hyper_link=False)
# print("Output database:",result)

# query = MultiQuery()
# result = query.query_new_database(atts=['AT2G03340'], number_process=4,
# multi_processing=False, multi_threading=False, dbs=['arabidopsis'])
# query.save(result, save_path="./result/", format=["csv", "html", "json", "pkl"], hyper_link=False)
# print("Output database:", result)


# chro="chr01", start_pos="1", end_pos="43270923"
# chro="chr02", start_pos="1", end_pos="35937250"
Expand Down
6 changes: 3 additions & 3 deletions pyrice/multi_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import os
import copy
import json2table
from IPython.display import HTML

class MultiQuery():
"""
Expand Down Expand Up @@ -254,7 +253,8 @@ def save(result, save_path, format=None, hyper_link=False):
elif form == "html":
my_db = data_folder + "db" + '.html'
df = pd.DataFrame.from_dict(html_dict, orient='index')
HTML(df.to_html(my_db,escape=False))
# HTML(df.to_html(my_db,escape=False))
df.to_html(my_db, escape=False)
elif form =="json":
my_db = data_folder + "db" + '.json'
with open(my_db, 'w') as f:
Expand Down Expand Up @@ -781,7 +781,7 @@ def query_new_database(self, atts, number_process = cpu_count() -1, multi_proces
print("Query attribute: {} --- attribute {}/{}".format(key, i, number_query))
self.result.setdefault(key,dict())
for db in name_db:
tmp = self.query(key, db, [key])
tmp = self.query(key, db, [key],True)
if tmp != None:
self.result[tmp[0]].setdefault(tmp[1], tmp[2])
i+=1
Expand Down

0 comments on commit be09bb6

Please sign in to comment.