Skip to content

map data type function for sQTL contexts#367

Closed
Chunmingl wants to merge 3 commits intoStatFunGen:mainfrom
Chunmingl:main
Closed

map data type function for sQTL contexts#367
Chunmingl wants to merge 3 commits intoStatFunGen:mainfrom
Chunmingl:main

Conversation

@Chunmingl
Copy link
Copy Markdown
Contributor

No description provided.

Comment thread R/file_utils.R
map_data_type <- function(data_type_table, context_names){
data_type <- lapply(context_names, function(context){
xqtl_type_table$type[apply(xqtl_type_table, 1, function(x) {
if (! grepl("sQTL",context)) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Chunmingl am not entirely sure what we are trying to do here but anything hard-coded is not good. If you want to map data, we should take proper regular expression (search for " regex in R" ) then we provide some external files called qtl_type_mapping that look like this:

sQTL, "clu_(\\d+_[+-.]):"

which is the pattern for sQTL event names.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just as an exmaple. Then you load this external file and use this to help you identify the correct data types

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

got it, I will update the function using regex

@Chunmingl Chunmingl closed this Mar 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants