Network-oriented Gibbs sampling for sequence motif detection