%global __brp_check_rpaths %{nil} %global packname ExplodeLayout %global packver 0.1.2 %global rlibdir /usr/local/lib/R/library Name: R-CRAN-%{packname} Version: 0.1.2 Release: 1%{?dist}%{?buildtag} Summary: Calculate Exploded Coordinates Based on Original Node Coordinates and Node Clustering Membership License: MIT + file LICENSE URL: https://cran.r-project.org/package=%{packname} Source0: %{url}&version=%{packver}#/%{packname}_%{packver}.tar.gz BuildRequires: R-devel >= 2.10 Requires: R-core >= 2.10 BuildArch: noarch BuildRequires: R-CRAN-ggplot2 BuildRequires: R-utils Requires: R-CRAN-ggplot2 Requires: R-utils %description Current layout algorithms such as Kamada Kawai do not take into consideration disjoint clusters in a network, often resulting in a high overlap among the clusters, resulting in a visual “hairball” that often is uninterpretable. The ExplodeLayout algorithm takes as input (1) an edge list of a unipartite or bipartite network, (2) node layout coordinates (x, y) generated by a layout algorithm such as Kamada Kawai, (3) node cluster membership generated from a clustering algorithm such as modularity maximization, and (4) a radius to enable the node clusters to be “exploded” to reduce their overlap. The algorithm uses these inputs to generate new layout coordinates of the nodes which “explodes” the clusters apart, such that the edge lengths within the clusters are preserved, while the edge lengths between clusters are recalculated. The modified network layout with nodes and edges are displayed in two dimensions. The user can experiment with different explode radii to generate a layout which has sufficient separation of clusters, while reducing the overall layout size of the network. This package is a basic version of an earlier version called [epl] that searched for an optimal explode radius, and offered multiple ways to separate clusters in a network (Bhavnani et al(2017) ). The example dataset is for a bipartite network, but the algorithm can work also for unipartite networks. %prep %setup -q -c -n %{packname} # fix end of executable files find -type f -executable -exec grep -Iq . {} \; -exec sed -i -e '$a\' {} \; # prevent binary stripping [ -d %{packname}/src ] && find %{packname}/src -type f -exec \ sed -i 's@/usr/bin/strip@/usr/bin/true@g' {} \; || true [ -d %{packname}/src ] && find %{packname}/src/Make* -type f -exec \ sed -i 's@-g0@@g' {} \; || true # don't allow local prefix in executable scripts find -type f -executable -exec sed -Ei 's@#!( )*/usr/local/bin@#!/usr/bin@g' {} \; %build %install mkdir -p %{buildroot}%{rlibdir} %{_bindir}/R CMD INSTALL -l %{buildroot}%{rlibdir} %{packname} test -d %{packname}/src && (cd %{packname}/src; rm -f *.o *.so) rm -f %{buildroot}%{rlibdir}/R.css # remove buildroot from installed files find %{buildroot}%{rlibdir} -type f -exec sed -i "s@%{buildroot}@@g" {} \; %files %{rlibdir}/%{packname}