attachments: Drugs/ Carriers/ Enzymes/ Targets/ Transporters attachments...

Description Usage Arguments Value read_drugbank_xml_db See Also Examples

Description

Return a list of attachment that were used as references for drugs carriers

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
drugs_attachments(
  save_table = FALSE,
  save_csv = FALSE,
  csv_path = ".",
  override_csv = FALSE,
  database_connection = NULL
)

carriers_attachments(
  save_table = FALSE,
  save_csv = FALSE,
  csv_path = ".",
  override_csv = FALSE,
  database_connection = NULL
)

enzymes_attachments(
  save_table = FALSE,
  save_csv = FALSE,
  csv_path = ".",
  override_csv = FALSE,
  database_connection = NULL
)

targets_attachments(
  save_table = FALSE,
  save_csv = FALSE,
  csv_path = ".",
  override_csv = FALSE,
  database_connection = NULL
)

transporters_attachments(
  save_table = FALSE,
  save_csv = FALSE,
  csv_path = ".",
  override_csv = FALSE,
  database_connection = NULL
)

Arguments

save_table

boolean, save table in database if true.

save_csv

boolean, save csv version of parsed tibble if true

csv_path

location to save csv files into it, default is current location, save_csv must be true

override_csv

override existing csv, if any, in case it is true in the new parse operation

database_connection

DBI connection object that holds a connection to user defined database. If save_table is enabled without providing value for this function an error will be thrown.

Value

a tibble with 4 variables:

ref-id

Identifier for the article being referenced. This is unique across all reference types (books, links, article, attachments).

title

The title of the attachment.

url

The url to download the attachment from.

parent_id

drug/carrier/target/enzyme/transporter id

read_drugbank_xml_db

read_drugbank_xml_db function must be called first before any parser.

If read_drugbank_xml_db is called before for any reason, so no need to call it again before calling this function.

See Also

Other references: articles, books, links, references()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
## Not run: 
# the same parameters and usage will be applied for any parser
# return only the parsed tibble
run_all_parsers()

# will throw an error, as database_connection is NULL
run_all_parsers(save_table = TRUE)

# save in database in SQLite in memory database and return parsed tibble
sqlite_con <- DBI::dbConnect(RSQLite::SQLite())
run_all_parsers(save_table = TRUE, database_connection = sqlite_con)

# save parsed tibble as csv if it does not exist in current location,
# and return parsed tibble.
# if the csv exist before read it and return its data.
run_all_parsers(save_csv = TRUE)

# save in database, save parsed tibble as csv,
# if it does not exist in current location and return parsed tibble.
# if the csv exist before read it and return its data.
run_all_parsers(save_table = TRUE, save_csv = TRUE,
database_connection = sqlite_con)

# save parsed tibble as csv if it does not exist in given location,
# and return parsed tibble.
# if the csv exist before read it and return its data.
run_all_parsers(save_csv = TRUE, csv_path = TRUE)

# save parsed tibble as csv if it does not exist in current location and
# return parsed tibble.
# if the csv exist override it and return it.
run_all_parsers(save_csv = TRUE, csv_path = TRUE, override = TRUE)

## End(Not run)

ropensci/dbparser documentation built on Aug. 28, 2020, 7:25 a.m.