Re: [igraph] Motifs in igraph

2018-10-19 Thread Szabolcs Horvát
You can use subgraph_isomorphisms with the lad method and induced=TRUE

http://igraph.org/r/doc/subgraph_isomorphisms.html

It will tell you where exactly the motif (i.e. induced subgraph)
appears in the graph.
On Fri, 19 Oct 2018 at 01:15, Stuart Kininmonth
 wrote:
>
>
>
> Hi Igraphers’,
>
>
>
> Has anybody developed code in R or python that can find motifs of various 
> configurations (from 3 and 4 node motifs) that also keeps a list of the node 
> identities?
>
> This would then enable me to see the relationship of the node to the other 
> nodes via the shared motifs.
>
>
>
> With thanks
>
>
>
> Stuart
>
>
>
>
>
> Stuart Kininmonth PhD
>
> Deputy Head of School
> Senior Lecturer
>
>   :Coral Reef Ecology and Management
>   :Marine Spatial Planning
>
>   :Marine Geology
> School of Marine Studies
> Faculty of Science, Technology & Environment
> The University of South Pacific
> Laucala Bay Road, Suva, Fiji Islands
> Tel: (+679) 32 32943  Ext.: 32943
>
> stuart.kininmo...@usp.ac.fj
>
> M: +679 8660103
>
>
>
>
>
>
>
>
>
> ___
> igraph-help mailing list
> igraph-help@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/igraph-help

___
igraph-help mailing list
igraph-help@nongnu.org
https://lists.nongnu.org/mailman/listinfo/igraph-help


Re: [igraph] motifs

2016-11-07 Thread Manuel J. Zetina-Rejón
Hi Tamas,

Thank you, I got it.

Manuel
=
Dr. Manuel J.  Zetina-Rejón
Instituto Politécnico Nacional
Centro Interdisciplinario de Ciencias Marinas
Lab. de Dinámica y Manejo de Ecosistemas Acuáticos
Av. Instituto Politénico Nacional S/N Col. Playa Palo de Sta. Rita La Paz, BCS, 
México
CP 23096
Tel. +52 (612) 1234658  Ext. 82452 
Fax. +52(612) 1225322
http://www.cicimar.ipn.mx 

Visualízame
http://vizualize.me/mjzetina

Google Scholar
http://scholar.google.com.mx/citations?user=Whcz9wUJ&hl=es 


ResearchGate
https://www.researchgate.net/profile/Manuel_Zetina-Rejon 

=

> El 07/11/2016, a las 04:42, Tamas Nepusz  escribió:
> 
> Hi and sorry for the late reply, this email has fallen through the
> cracks somehow. (I was on the road in China for a few weeks with
> limited internet access).
> 
>> On the other hand, motifs() returns a vector with the number of occurences
>> of each motif in the graph ordered by their isomorphism class. How do I know
>> which isomorphism class are present in my graph. I mean, a possible result
>> of motifs(graph, size =3) could be something like this:
>>> NA NA 32 18
>> 
>> For me, this means that there are 32 motifs of x-isomorphic class and other
>> 18 motifs of y-isomorphic class. But, which classes?
> The i-th element of the vector corresponds to the motif with
> isomorphism class i. So, you can indeed use
> graph_from_isomorphism_class() to figure out how the motif looks like.
> The only catch is that, unlike everything else in R, isomorphism
> classes are zero-based, so the two NAs belong to isomorphism classes 0
> (empty graph) and 1 (two vertices connected, and a third isolated
> vertex), and then you have 32 occurrences of isomorphism class 2 (V
> shape) and 18 occurrences of isomorphism class 3 (full triangle).
> 
> T.
> 
> ___
> igraph-help mailing list
> igraph-help@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/igraph-help

___
igraph-help mailing list
igraph-help@nongnu.org
https://lists.nongnu.org/mailman/listinfo/igraph-help


Re: [igraph] motifs

2016-11-07 Thread Tamas Nepusz
Hi and sorry for the late reply, this email has fallen through the
cracks somehow. (I was on the road in China for a few weeks with
limited internet access).

> On the other hand, motifs() returns a vector with the number of occurences
> of each motif in the graph ordered by their isomorphism class. How do I know
> which isomorphism class are present in my graph. I mean, a possible result
> of motifs(graph, size =3) could be something like this:
>> NA NA 32 18
>
> For me, this means that there are 32 motifs of x-isomorphic class and other
> 18 motifs of y-isomorphic class. But, which classes?
The i-th element of the vector corresponds to the motif with
isomorphism class i. So, you can indeed use
graph_from_isomorphism_class() to figure out how the motif looks like.
The only catch is that, unlike everything else in R, isomorphism
classes are zero-based, so the two NAs belong to isomorphism classes 0
(empty graph) and 1 (two vertices connected, and a third isolated
vertex), and then you have 32 occurrences of isomorphism class 2 (V
shape) and 18 occurrences of isomorphism class 3 (full triangle).

T.

___
igraph-help mailing list
igraph-help@nongnu.org
https://lists.nongnu.org/mailman/listinfo/igraph-help


Re: [igraph] motifs

2016-10-14 Thread Manuel Zetina-Rejon
Hi Tamas!

Thank you very much for your reply. Actually, it makes sense to me on the use 
of connected subgraphs as motifs, in the sense that an isolated vertex doesn’t 
play a important role in the subgraph structure.

On the other hand, motifs() returns a vector with the number of occurences of 
each motif in the graph ordered by their isomorphism class. How do I know which 
isomorphism class are present in my graph. I mean, a possible result of 
motifs(graph, size =3) could be something like this:
> NA NA 32 18

For me, this means that there are 32 motifs of x-isomorphic class and other 18 
motifs of y-isomorphic class. But, which classes? I’ve playing with something 
like this to explore how all possible isomorphic classes (n = 3) look like:

iso <- vector(mode = "list", length = 3)
iso.class <- 1:length(iso)

for(i in 1:length(iso)){
  iso[[i]] <- graph_from_isomorphism_class(3, i, directed = FALSE)
iso[[i]]$name <- paste("Class", iso.class[i])
}

par(mfrow = c(1,3))
for(i in 1:length(iso)){
plot(iso[[i]], layout = layout_in_circle(iso[[i]]),  main = iso[[i]]$name)
}

But How do I know which of them are present in the original graph?

Thank you very much!

Manuel

> El 14/10/2016, a las 02:31, Tamas Nepusz  escribió:
> 
> Hi!
> 
> I haven't read the papers once again, but in my opinion a disconnected
> motif doesn't really make sense. Consider a disconnected motif that
> consists of a fully connected triangle and an additional isolated
> vertex, and then take a graph that contains one triangle and one
> million isolated vertices. Does that really mean that this "motif"
> appears one million times in the graph? Is that a significant finding?
> If I added an additional one million totally unrelated vertices to the
> graph, does that make the motif appear twice as frequently?
> 
> Anyway, if you want to search for disconnected patterns in a graph,
> you can still use count_subgaph_isomorphisms() with method="lad" and
> induced=TRUE; see:
> 
> http://igraph.org/r/doc/count_subgraph_isomorphisms.html
> 
> It will be much slower, though -- searching for connected motifs is
> much easier if the average degree of a vertex is low.
> 
> T.
> 
> 
> On Fri, Oct 14, 2016 at 8:59 AM, Manuel Zetina-Rejon  
> wrote:
>> Hi Guys!
>> 
>> This is probably a basic question, but I don’t find the clear criteria or 
>> reference, why in igraph help, you mention that unconnected subgraphs (of x 
>> isomorphic class) are not considered motifs? For that reason, motifs() is NA 
>> for unconnected subgraphs. It is also not clear if you mean strongly or 
>> weakly connected subgraphs
>> 
>> According to Milo et al. (2002) and Shen-Orr et al. (2002) motifs are not 
>> necessarily connected, even in directed graphs.
>> 
>> Thank you for your opinions
>> 
>> 
>> Manuel
>> ___
>> igraph-help mailing list
>> igraph-help@nongnu.org
>> https://lists.nongnu.org/mailman/listinfo/igraph-help
> 
> ___
> igraph-help mailing list
> igraph-help@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/igraph-help

___
igraph-help mailing list
igraph-help@nongnu.org
https://lists.nongnu.org/mailman/listinfo/igraph-help


Re: [igraph] motifs

2016-10-14 Thread Tamas Nepusz
Hi!

I haven't read the papers once again, but in my opinion a disconnected
motif doesn't really make sense. Consider a disconnected motif that
consists of a fully connected triangle and an additional isolated
vertex, and then take a graph that contains one triangle and one
million isolated vertices. Does that really mean that this "motif"
appears one million times in the graph? Is that a significant finding?
If I added an additional one million totally unrelated vertices to the
graph, does that make the motif appear twice as frequently?

Anyway, if you want to search for disconnected patterns in a graph,
you can still use count_subgaph_isomorphisms() with method="lad" and
induced=TRUE; see:

http://igraph.org/r/doc/count_subgraph_isomorphisms.html

It will be much slower, though -- searching for connected motifs is
much easier if the average degree of a vertex is low.

T.


On Fri, Oct 14, 2016 at 8:59 AM, Manuel Zetina-Rejon  wrote:
> Hi Guys!
>
> This is probably a basic question, but I don’t find the clear criteria or 
> reference, why in igraph help, you mention that unconnected subgraphs (of x 
> isomorphic class) are not considered motifs? For that reason, motifs() is NA 
> for unconnected subgraphs. It is also not clear if you mean strongly or 
> weakly connected subgraphs
>
> According to Milo et al. (2002) and Shen-Orr et al. (2002) motifs are not 
> necessarily connected, even in directed graphs.
>
> Thank you for your opinions
>
>
> Manuel
> ___
> igraph-help mailing list
> igraph-help@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/igraph-help

___
igraph-help mailing list
igraph-help@nongnu.org
https://lists.nongnu.org/mailman/listinfo/igraph-help