overlap

Common genomic intervals in R

£可爱£侵袭症+ 提交于 2019-12-04 14:21:48
I would like to infer shared genomic interval between different samples. My input: sample chr start end NE001 1 100 200 NE001 2 100 200 NE002 1 50 150 NE002 2 50 150 NE003 2 250 300 My expected output: chr start end freq 1 100 150 2 2 100 150 2 Where the "freq" is the how many samples have contribuited to infer the shared region. In the above example freq = 2 (NE001 and NE002). Cheers! If your data is in a data.frame (see below), using the Bioconductor GenomicRanges package I create a GRanges instance, keeping the non-range columns too library(GenomicRanges) gr <- makeGRangesFromDataFrame(df,

Prevent creation of overlapping date ranges

大憨熊 提交于 2019-12-04 13:41:11
I have a certain event in the calendar assigned to a storeID that has a sdate (ShowDate) and an hdate (HideDate). Now for every new event with this storeID, I need to make sure that there's no overlap with an existing date period. Does that make sense? How do I do that? I read about stuff but couldn't figure out how to "insert only if not overlap". Jonathan Leffler In general, if you have two ranges with S1..E1 and S2..E2 as the start and end values of the ranges, then you have an overlap if: S1 < E2 and S2 < E1 This is symmetric, which is good (and reassuring). You will need to decide

Making widgets partly overlap in a Qt layout

醉酒当歌 提交于 2019-12-04 12:21:02
I am trying to make widgets overlap partly in a Qt layout. My current layout is the following, achieved with a QVBoxLayout containing four QHBoxLayout children: I'm trying to regroup cards of the same suit, in order to achieve something like this (note that there is horizontal and vertical overlapping): Unfortunately, all the Qt documentation and all the Stack Overflow posts I have read try to avoid widgets overlapping rather than to seek it. Maybe there's a way to set negative spacing between widgets, or forcing a layout to have a maximum width calculated (e.g. according to the number of

st_intersects Vs st_overlaps

删除回忆录丶 提交于 2019-12-04 08:39:08
What is the difference between these two queries : select a.gid, sum(length(b.the_geom)) from polygons as a , roads as b where st_intersects(a.the_geom,b.the_geom) group by a.gid ; select a.gid, sum(length(b.the_geom)) from polygons as a , roads as b where st_overlaps(a.the_geom,b.the_geom) group by a.gid ; Where the first query is giving the correct output whereas the second query retrieves no rows at all. The road that intersects the polygons also overlaps it, right? From the documentation of PostGIS http://postgis.net/docs/ST_Intersects.html If a geometry or geography shares any portion of

primefaces menu cant fully display out in fullpage layout

霸气de小男生 提交于 2019-12-04 08:15:06
few days ago i ask 1 question in primefaces forum but nobody reply me. I facing a problem while using in fullpage layout(position="west"), the submenu can't fully display out. Can make it display overlap to the (position="center") as I don't wish to increase the width of the west layout? below link atatch with a picture as reference. http://www.imagebucket.net/bucket/is.php?i=10434&img=image.jpg this is part of the code: <p:layoutUnit position="west" size="200" > <ui:insert name="sideBar"> <h:form> <p:menu type="tiered" > <p:submenu label="Sales" > <p:menuitem disabled="#{user.customer}" value

Spread overlapping points in a circle - R

帅比萌擦擦* 提交于 2019-12-04 05:08:27
问题 I have a number of points in R which are overlapping -> my idea is to create a new coordinates column where I spread them out in a circle. I don't want to jitter; it looks ugly and is misleading -> it makes the viewer think that the data is actually like that, rather than it has just been presented like that for visibility. I think a circle or sunflower or star spread looks nice so that's what I want to do. What I have is not working great I think because of the geographic projections: Before

R / lubridate: Calculate number of overlapping days between two periods

依然范特西╮ 提交于 2019-12-04 02:52:56
问题 I am trying to calculate the number of overlapping days between two time periods. One period is fixed in a start and end date, the other is recorded as start and end dates in a data frame. Edit: I'm dealing with ads that have publish date (df$start) and an unpublish date (df$end). What I'm trying to find out is how many days they have been online in a specific month (my.start = 2018-01-01, my.end = 2018-08-31). library(dplyr) library(lubridate) my.start <- ymd("2018-08-01") my.end <- ymd(

How to fix strcpy so that it detects overlapping strings

…衆ロ難τιáo~ 提交于 2019-12-04 02:25:29
In an interview, I was asked to write an implementation of strcpy and then fix it so that it properly handles overlapping strings. My implementation is below and it is very naive. How do I fix it so that: It detects overlapping strings and after detecting, how do we deal with the overlap and proceed? char* my_strcpy(char *a, char *b) { if (a == NULL || b == NULL) { return NULL; } if (a > b) { //we have an overlap? return NULL; } char *n = a; while (*b != '\0') { *a = *b; a++; b++; } *a = '\0'; return n; } int main(int argc, char *argv[]) { char str1[] = "wazzupdude"; char *after_cpy = my

using renderOrder in three.js

醉酒当歌 提交于 2019-12-03 20:06:39
I want to have two overlapping objects in a scene but I want to define which object should be drawn first. I have a sample of the code here: http://jsfiddle.net/sg02e5sm/1/ I'm using renderOrder = 1 for the second object to make it appear always on top of the first object (as long as they have the same Z value), but it's not working. WestLangley renderOrder does not make something appear "on top". It controls the order in which objects are rendered. If you want your 2nd plane to be "on top", you can add mesh.material.depthTest = false; for the 2nd plane, for example. fiddle: http://jsfiddle

ggplot2: How to combine histogram, rug plot, and logistic regression prediction in a single graph

旧城冷巷雨未停 提交于 2019-12-03 16:09:10
I am trying to plot combined graphs for logistic regressions as the function logi.hist.plot but I would like to do it using ggplot2 (aesthetic reasons). The problem is that only one of the histograms should have the scale_y_reverse(). Is there any way to specify this in a single plot (see code below) or to overlap the two histograms by using coordinates that can be passed to the previous plot? ggplot(dat) + geom_point(aes(x=ind, y=dep)) + stat_smooth(aes(x=ind, y=dep), method=glm, method.args=list(family="binomial"), se=FALSE) + geom_histogram(data=dat[dat$dep==0,], aes(x=ind)) + geom