title: Remove self loops and vertex with no edges
body: <p>I am constructing a gene network. I have a two column data frame which i converted into and adjacency matrix and use it in igraph. The problem is i have genes that have self loops, I want to get rid of self loops and then get rid of the vertices that have no edge (isolated maybe) from the network. I have tried a few things but somehow they do not work. My code is </p>
  
  <pre><code> InnatedGraph &lt;- graph.data.frame(innate,directed=FALSE)
   V(InnatedGraph)$label.cex = 0.4
   plot(InnatedGraph,vertex.label=V(InnatedGraph)$symbol, vertex.size=5)
  </code></pre>
  
  <p>innate is my two column data frame. I have tried the degree function to remove vertices with 0 degree but i guess unfortunately it does not work (maybe becoz the self loop genes have degree 1).</p>
  
  <pre><code>bad.vs&lt;-V(InnatedGraph)[degree(InnatedGraph) == 0] 
  clean &lt;-delete.vertices(InnatedGraph, bad.vs)
  </code></pre>
  
  <p>I tried using another function from package BioNet "rmSelfLoops" with the help of which i was able to remove the self loop edges but then still unable to remove the vertices with no edges.</p>
  
  <pre><code>test&lt;-rmSelfLoops(InnatedGraph)
  </code></pre>
  
  <p>I will also include a picture of my network just to make it easier to understand.<a href="https://i.stack.imgur.com/9qdkw.png" rel="noreferrer"><img src="https://i.stack.imgur.com/9qdkw.png" alt="enter image description here"></a></p>